Changeset 3827 for trunk/src


Ignore:
Timestamp:
Jul 15, 2000, 7:12:02 PM (25 years ago)
Author:
sandervl
Message:

fixed support for paths with spaces

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/peldr/pe.cpp

    r3823 r3827  
    1 /* $Id: pe.cpp,v 1.18 2000-07-15 09:13:54 sandervl Exp $ */
     1/* $Id: pe.cpp,v 1.19 2000-07-15 17:12:02 sandervl Exp $ */
    22
    33/*
     
    8585 char  *cmdline, *win32cmdline;
    8686 BOOL   fQuote = FALSE;
     87 int    nrTries = 1;
    8788
    8889  if(argc >= 2) {
    8990        if(DosGetInfoBlocks(&ptib, &ppib) == 0) {
     91tryagain:
    9092                cmdline = ppib->pib_pchcmd;
    9193                cmdline += strlen(cmdline)+1;   //skip pe.exe
     
    104106                }
    105107                else {
    106                         while(*p != ' ' && *p != 0) p++;
     108                        for(int i=0;i<nrTries;i++) {
     109                                while(*p != ' ' && *p != 0) p++;
     110                                if(*p == 0) break;
     111                                if(i != nrTries-1) {
     112                                        while(*p == ' ' && *p != 0) p++;
     113                                }
     114                        }
    107115                }
    108116                *p = 0;
     
    135143                        strcpy(exeName, fullpath);
    136144                }
     145                FILESTATUS3 fstat3;
     146                if(DosQueryPathInfo(exeName, FIL_STANDARD, (PVOID)&fstat3, sizeof(fstat3)))
     147                {
     148                        nrTries++;
     149                        if(*win32cmdline != NULL) {
     150                                goto tryagain;
     151                        }
     152                }
    137153        }
    138154        else {//should never happen!
     155filenotfound:
    139156                DebugInt3();
    140157                rc = DosLoadModule(exeName, sizeof(exeName), "PMWIN.DLL", &hmodPMWin);
Note: See TracChangeset for help on using the changeset viewer.