wcmd: fix for handing executiong from CreateProcess

Aric Stewart aric at codeweavers.com
Fri Dec 2 11:48:09 CST 2005


When executed from CreateProcess we do not get wcmd.exe as the first 
parameter (like when executed from the command line) so to not skip the 
first parameter automatically.
-------------- next part --------------
Index: programs/wcmd/wcmdmain.c
===================================================================
RCS file: /home/wine/wine/programs/wcmd/wcmdmain.c,v
retrieving revision 1.50
diff -u -r1.50 wcmdmain.c
--- programs/wcmd/wcmdmain.c	2 Dec 2005 10:30:04 -0000	1.50
+++ programs/wcmd/wcmdmain.c	2 Dec 2005 17:45:30 -0000
@@ -57,7 +57,17 @@
   HANDLE h;
   int opt_c, opt_k, opt_q;
 
-  argv++;
+  /* when run from the command line we get wcmd.exe ...
+   * however!
+   * when run with CreateProcess we do not get the leading wcmd.exe so we do not
+   * want to skip the first argv.
+   *
+   * this may be a bug in CreateProcess, or with the wine script but we need to
+   * deal with this irregularlity or calls from CreateProcess fail
+   */
+  if (strcasecmp(*argv,"wcmd.exe")==0)
+      argv++;
+
   opt_c=opt_k=opt_q=0;
   while (*argv!=NULL)
   {


More information about the wine-patches mailing list