Changeset 22032


Ignore:
Timestamp:
Oct 22, 2012, 8:04:43 PM (8 years ago)
Author:
dmik
Message:

pe: Fix r22028.

File:
1 edited

Legend:

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

    r22029 r22032  
    199199        win32cmdline = pszTemp;
    200200
     201        // get the filename component
     202        pszTemp = exeName + strlen(exeName) - 1;
     203        while (pszTemp >= exeName && (*pszTemp != '\\' && *pszTemp != '/'))
     204            --pszTemp;
     205        ++pszTemp;
     206
    201207        // add the .EXE extension if missing (only if there's no extension already)
    202         if (*str_find_last_char(exeName, '.') == '\0')
     208        if (*str_find_char(pszTemp, '.') == '\0')
    203209        {
    204210            int i = strlen(exeName);
     
    208214
    209215        // try to locate the executable
    210         pszTemp = exeName + strlen(exeName) - 1;
    211         while (pszTemp >= exeName && (*pszTemp != '\\' && *pszTemp != '/'))
    212             --pszTemp;
    213         if (pszTemp < exeName)
     216        if (pszTemp == exeName)
    214217        {
    215218            // no path information, perform a search
Note: See TracChangeset for help on using the changeset viewer.