Changeset e314db in git


Ignore:
Timestamp:
Mar 4, 2016, 11:08:31 AM (8 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
fb24e814923417fdd0141344e491a098207148f9
Parents:
93e3ef8d65a31285cdb950111efb60f28f8998a7
Message:
fix: omFindExec for CYGWIN
File:
1 edited

Legend:

Unmodified
Added
Removed
  • resources/omFindExec.c

    r93e3ef re314db  
    3939  char *search;
    4040  char *p;
    41 #ifdef WINNT
    42   char *extra = NULL;
    43 #endif
    4441  char tbuf[MAXPATHLEN];
    4542
     
    5047      {
    5148        strcpy(executable, name);
    52 #ifdef __CYGWIN__
    53         strcat(executable, ".exe");
    54 #endif
    5549        return executable;
    5650      }
     
    7569      {
    7670        strcpy(executable, tbuf);
    77 #ifdef __CYGWIN__
    78         strcat(executable, ".exe");
    79 #endif
    8071        return executable;
    8172      }
     
    8576    search = getenv("PATH");
    8677/* for winnt under msdos, cwd is implictly in the path */
    87 #ifdef WINNT
    88     p = getenv("SHELL");
    89     if (p == NULL || strlen(p) < 2)
    90     {
    91       char *extra = NULL;
    92       /* we are under msdos display */
    93       extra = (char*) malloc((search != NULL ? strlen(search) : 0) + 3);
    94       strcpy(extra, ".:");
    95       if (search != NULL) strcat(extra, search);
    96       search = extra;
    97     }
    98 #endif
    9978    p = search;
    10079
     
    129108        if (! access (tbuf, F_OK))
    130109        {
    131 #ifdef WINNT
    132           if (extra != NULL)
    133             free(extra);
    134 #endif
    135110          strcpy(executable, tbuf);
    136 #ifdef __CYGWIN__
    137           strcat(executable, ".exe");
    138 #endif
    139111          return executable;
    140112        }
     
    219191}
    220192
    221 #ifdef WINNT
     193#ifdef __CYGWIN__
     194/* for windows, serch first for .exe */
    222195char * _omFindExec (const char *name, char* exec);
    223 /* for windows, serch first for .exe */
    224196char* omFindExec(const char *name, char* exec)
    225197{
Note: See TracChangeset for help on using the changeset viewer.