Ignore:
Timestamp:
May 9, 2000, 8:56:59 PM (25 years ago)
Author:
sandervl
Message:

lots of changes/fixes

File:
1 edited

Legend:

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

    r3375 r3501  
    1 /* $Id: winexepeldr.cpp,v 1.8 2000-04-14 22:35:28 sandervl Exp $ */
     1/* $Id: winexepeldr.cpp,v 1.9 2000-05-09 18:56:09 sandervl Exp $ */
    22
    33/*
     
    6767  }
    6868
    69   szFullCmdLine = (char *)malloc(strlen(szFileName) + 1 + strlen(szCmdLine) + 1);
    70   strcpy(szFullCmdLine, 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);
    7176  strcat(szFullCmdLine, " ");
    7277  strcat(szFullCmdLine, szCmdLine);
Note: See TracChangeset for help on using the changeset viewer.