Changeset 39d6b4 in git


Ignore:
Timestamp:
May 20, 1998, 3:22:21 PM (25 years ago)
Author:
Kai Krüger <krueger@…>
Branches:
(u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
Children:
69d99e7fda7f7dc17d1c56b4a0ec52a8fb60e9ae
Parents:
5a5c1677300fb827a08b15c78a4921fd8b09e9dd
Message:
Added followup-symlinks to find_executable


git-svn-id: file:///usr/local/Singular/svn/trunk@1948 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/find_exec.c

    r5a5c16 r39d6b4  
    6363      if (! access (name, X_OK)) {
    6464        struct stat stat_temp;
     65        char buf[MAXPATHLEN];
     66        int ret;
    6567
    6668        if (stat (name, &stat_temp))
    6769          return 0;
    6870
     71#ifdef HAVE_READLINK
     72        if( (ret=readlink(name, buf, MAXPATHLEN))>0) {
     73          char *p = strrchr(name, '/');
     74          if(p!=NULL) *(p+1)='\0';
     75          buf[ret]='\0';
     76          if(buf[0]=='/') return(find_executable(buf));
     77          strcat(name, buf);
     78          return(find_executable(name));
     79        }
     80#endif /* HAVE_READLINK */
    6981#ifndef STAT_MACROS_BROKEN
    7082        if (! S_ISREG(stat_temp.st_mode))
    7183          return 0;
    7284#endif
     85       
    7386        return copy_of (name);
    7487      }
     
    175188      if (! access (tbuf, X_OK)) {
    176189        struct stat stat_temp;
     190        char buf[MAXPATHLEN];
     191        int ret;
    177192
    178193        if (stat (tbuf, &stat_temp))
    179194          continue;
    180195
     196#ifdef HAVE_READLINK
     197        if( (ret=readlink(tbuf, buf, MAXPATHLEN))>0) {
     198          char *p = strrchr(tbuf, '/');
     199          if(p!=NULL) *(p+1)='\0';
     200          buf[ret]='\0';
     201          if(buf[0]=='/') return(find_executable(buf));
     202          strcat(tbuf, buf);
     203          return(find_executable(tbuf));
     204        }
     205#endif /* HAVE_READLINK */
    181206#ifndef STAT_MACROS_BROKEN
    182207        if (! S_ISREG(stat_temp.st_mode))
Note: See TracChangeset for help on using the changeset viewer.