From: SourceForge.net <no...@so...> - 2007-05-30 09:18:39
|
Bugs item #1728144, was opened at 2007-05-30 11:18 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1728144&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: msys Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Julien Lecomte (julienlecomte) Assigned to: Nobody/Anonymous (nobody) Summary: command line adds an extra space Initial Comment: I've noticed that the msys runtime will often add at least a trailing space (if more than one trailing space exists on the commandline, we can expect that it is expanded back to 1) Simple test case: == BOF test1.c == #include <stdio.h> #include <windows.h> int APIENTRY WinMain (HINSTANCE hinstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { printf("lpCmdLine (%d) = **%s**\n", strlen(lpCmdLine), lpCmdLine); // strip right trailing spaces CHAR* cstrip = lpCmdLine + strlen(lpCmdLine) - 1; while (*cstrip == ' ') *cstrip-- = 0; printf("stripped (%d) = **%s**\n\n", strlen(lpCmdLine), lpCmdLine); return 0; } == EOF test1.c == With the folowing commands (please note that spaces are important) julienlecomte@PUMILIO ~ $ ./test1.exe "toto1" lpCmdLine (6) = **toto1 ** stripped (5) = **toto1** $ ./test1.exe toto3&& ./test1.exe toto4 lpCmdLine (6) = **toto3 ** stripped (5) = **toto3** A mailing list archive of this discussion can be found here: http://thread.gmane.org/gmane.comp.gnu.mingw.user/22722/focus=22763 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1728144&group_id=2435 |