| 276 | #endif |
| 277 | |
| 278 | char * _omFindExec (const char *name, char* exec) |
| 279 | { |
| 280 | char * link = omFindExec_link(name, exec); |
| 281 | char buf[MAXPATHLEN]; |
| 282 | int ret; |
| 283 | |
| 284 | if (link == NULL && (ret=full_readlink(name, buf, MAXPATHLEN)) > 0) |
| 285 | { |
| 286 | buf[ret] ='\0'; |
| 287 | link = omFindExec_link(buf, exec); |
| 288 | } |
| 289 | if (link != NULL && (ret=full_readlink(link, buf, MAXPATHLEN)) > 0) |
| 290 | { |
| 291 | char *p = strrchr(link, '/'); |
| 292 | |
| 293 | |
| 294 | if(p!=NULL) *(p+1)='\0'; |
| 295 | buf[ret]='\0'; |
| 296 | |
| 297 | if (buf[0] != '/') |
| 298 | { |
| 299 | strcpy(exec, link); |
| 300 | strcat(exec, buf); |
| 301 | } |
| 302 | else |
| 303 | { |
| 304 | strcpy(exec, buf); |
| 305 | } |
| 306 | |
| 307 | return exec; |
| 308 | } |
| 309 | return link; |
| 310 | } |
| 311 | #endif /* HAVE_READLINK */ |
| 312 | |
| 313 | #else |
no test coverage detected