From d5003fc843b63265cd8ec004387b40593d29b472 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Fri, 5 Mar 2004 07:53:32 +0000 Subject: [PATCH] Fix problem of setting JAMSHELL to % and executing quoted commands. That combination would cause spawn: invalid argument errors. Now quotes are removed from the command if they are present. [SVN r22433] --- historic/jam/src/execnt.c | 7 +++++++ jam_src/execnt.c | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/historic/jam/src/execnt.c b/historic/jam/src/execnt.c index 457cc39c6..0914ae53b 100644 --- a/historic/jam/src/execnt.c +++ b/historic/jam/src/execnt.c @@ -674,6 +674,13 @@ execcmd( } /* the rest is for Windows NT only */ + /* spawn doesn't like quotes aroudn the command name */ + if ( argv[0][0] == '"') + { + int l = strlen(argv[0]); + if (argv[0][l-1] == '"') argv[0][l-1] = '\0'; + strcpy(argv[0],argv[0]+1); + } if( ( pid = spawnvp( P_NOWAIT, argv[0], argv ) ) == -1 ) { perror( "spawn" ); diff --git a/jam_src/execnt.c b/jam_src/execnt.c index 457cc39c6..0914ae53b 100644 --- a/jam_src/execnt.c +++ b/jam_src/execnt.c @@ -674,6 +674,13 @@ execcmd( } /* the rest is for Windows NT only */ + /* spawn doesn't like quotes aroudn the command name */ + if ( argv[0][0] == '"') + { + int l = strlen(argv[0]); + if (argv[0][l-1] == '"') argv[0][l-1] = '\0'; + strcpy(argv[0],argv[0]+1); + } if( ( pid = spawnvp( P_NOWAIT, argv[0], argv ) ) == -1 ) { perror( "spawn" );