Ignore:
Timestamp:
Oct 1, 2000, 2:05:57 PM (25 years ago)
Author:
sandervl
Message:

cmd line fix for pe loader

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/winexepeldr.cpp

    r4236 r4351  
    1 /* $Id: winexepeldr.cpp,v 1.10 2000-09-12 04:29:59 bird Exp $ */
     1/* $Id: winexepeldr.cpp,v 1.11 2000-10-01 12:05:57 sandervl Exp $ */
    22
    33/*
     
    6767  }
    6868
    69   /* Initiate the commandline.
    70    * (Since PE.EXE takes no options we'll currently just skip the
    71    * first parameter and used the passed in executable name.)
    72    */
    73   szCmdLine = szCmdLine; /* ignored */
    74   InitCommandLine(szFileName);
     69  //exe length + space + (possibly) 2x'"' + cmd line length + 0 terminator
     70  szFullCmdLine = (char *)malloc(strlen(szFileName) + 3 + strlen(szCmdLine) + 1);
     71  //Enclose executable name in quotes if it (or it's directory) contains spaces
     72  if(strchr(szFileName, ' ') != NULL) {
     73        sprintf(szFullCmdLine, "\"%s\"", szFileName);
     74  }
     75  else  strcpy(szFullCmdLine, szFileName);
     76  strcat(szFullCmdLine, " ");
     77  strcat(szFullCmdLine, szCmdLine);
     78  InitCommandLine(szFullCmdLine);
     79  dprintf(("Cmd line: %s", szFullCmdLine));
     80  free(szFullCmdLine);
    7581
    7682  if(getenv("WIN32_IOPL2")) {
Note: See TracChangeset for help on using the changeset viewer.