- Timestamp:
- Aug 22, 2021, 4:46:03 PM (3 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 854df13ac6faa7e37e7ed222c82d310f0c36eac1
- Parents:
- 5a396694da96c8e76a3c80f05fb25154009743c4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
resources/omFindExec.c
r5a39669 re892c8 123 123 } 124 124 } 125 /* try again with LD_LIBRARY_PATH */ 126 search = getenv("LD_LIBRARY_PATH"); 127 p = search; 128 129 if ((p != NULL)&&(strlen(p)>1)) 130 { 131 while (1) 132 { 133 char *next; 134 next = tbuf; 135 136 /* Copy directory name into [tbuf]. */ 137 /* This is somewhat tricky: empty names mean cwd, w.r.t. some 138 shell spec */ 139 while (*p && *p != ':') 140 *next ++ = *p ++; 141 *next = '\0'; 142 143 if (tbuf[strlen(tbuf)-1] != '/') strcat(tbuf, "/"); 144 strcat (tbuf, name); 145 146 /* If the named file exists, then return it. */ 147 if (! access (tbuf, F_OK)) 148 { 149 strcpy(executable, tbuf); 150 return executable; 151 } 152 153 if (*p != '\0') 154 { 155 p ++; 156 } 157 else 158 { 159 break; 160 } 161 } 162 } 163 } 164 /* everything failed, so try the compiled path: */ 165 strcpy(tbuf,BIN_DIR); 166 strcat(tbuf,"/"); 167 strcat(tbuf,name); 168 /* If the named file exists, then return it. */ 169 if (! access (tbuf, F_OK)) 170 { 171 strcpy(executable, tbuf); 172 return executable; 125 173 } 126 174 return NULL;
Note: See TracChangeset
for help on using the changeset viewer.