Changeset 39d6b4 in git
- Timestamp:
- May 20, 1998, 3:22:21 PM (25 years ago)
- Branches:
- (u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
- Children:
- 69d99e7fda7f7dc17d1c56b4a0ec52a8fb60e9ae
- Parents:
- 5a5c1677300fb827a08b15c78a4921fd8b09e9dd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/find_exec.c
r5a5c16 r39d6b4 63 63 if (! access (name, X_OK)) { 64 64 struct stat stat_temp; 65 char buf[MAXPATHLEN]; 66 int ret; 65 67 66 68 if (stat (name, &stat_temp)) 67 69 return 0; 68 70 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 */ 69 81 #ifndef STAT_MACROS_BROKEN 70 82 if (! S_ISREG(stat_temp.st_mode)) 71 83 return 0; 72 84 #endif 85 73 86 return copy_of (name); 74 87 } … … 175 188 if (! access (tbuf, X_OK)) { 176 189 struct stat stat_temp; 190 char buf[MAXPATHLEN]; 191 int ret; 177 192 178 193 if (stat (tbuf, &stat_temp)) 179 194 continue; 180 195 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 */ 181 206 #ifndef STAT_MACROS_BROKEN 182 207 if (! S_ISREG(stat_temp.st_mode))
Note: See TracChangeset
for help on using the changeset viewer.