Ticket #308: __spawnvpe.diff

File __spawnvpe.diff, 1.4 KB (added by KO Myung-Hun, 10 years ago)
  • src/lib/sys/__spawnve.c

     
    542542
    543543                /*
    544544                 * Resolve the interpreter name.
    545                  * If the specified name fails, we'll try search the path for it and
    546                  * also adding an .exe extension before we give up.
     545                 * If the specified name fails, try adding an .exe extension first.
     546                 * After, we'll try search the path for it and also adding an .exe
     547                 * extension before we give up.
    547548                 * We omit any specified path since we're frequently faced with path
    548549                 * differences between OS/2 and the UNIX where the script originated.
    549550                 */
    550551                rc = __libc_back_fsResolve(pszInterpreter, BACKFS_FLAGS_RESOLVE_FULL, &szNativePath[0], NULL);
    551552                if (rc)
     553                {   char szPath[512];
     554
     555                    strcpy(szPath, pszInterpreter);
     556                    _defext(szPath, "exe");
     557                    rc = __libc_back_fsResolve(szPath, BACKFS_FLAGS_RESOLVE_FULL, &szNativePath[0], NULL);
     558                }
     559                if (rc)
    552560                {
    553561                    psz = _getname(pszInterpreter);
    554562                    char szPath[512];