From: <no...@so...> - 2001-06-13 08:23:13
|
Bugs item #432499, was updated on 2001-06-12 11:47 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=110894&aid=432499&group_id=10894 >Category: Channel Types Group: 8.3.3 Status: Open Resolution: None Priority: 5 Submitted By: ken poole (kenpoole) Assigned to: Nobody/Anonymous (nobody) Summary: command string passed to exec not quoted Initial Comment: If I pass the fully qualified path to an executable that has spaces in its path to the exec command, it will execute properly. If I pass just the command name, it will error out with "invalid argument" as the error message. If I modify the source in tclWinPipe.c (starting at line 1525 from the packaged 8.3.3 tar ball) as follows: #define KEP_EXEC_PROBLEM #ifdef KEP_EXEC_PROBLEM if (arg[0] == '\0') { #else if (argv[i][0] == '\0') { #endif quote = 1; } else { #ifdef KEP_EXEC_PROBLEM for (start = arg; *start != '\0'; start++) { #else for (start = argv[i]; *start != '\0'; start++) { #endif the exec works as I expect. The second set of changes is what actually fixes my problem (start=arg). If the fully qualified path is specified, the argv[0] and arg contain identical strings. if invoked as: exec application the var argv[0] will contain "application", arg will contain the fully qualified path (ie c:\Program Files\appdir\application.exe). Since the code that checks for "quoting" was looking at argv[0], it wasnt seeing the "space" in the fully qualified path and the command to actually launch the app would fail. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=110894&aid=432499&group_id=10894 |