more searchpath-related changes

This commit is contained in:
rsc 2005-01-23 23:19:47 +00:00
parent 7c604f0ddf
commit de39860a2a
3 changed files with 3 additions and 1 deletions

View file

@ -331,6 +331,7 @@ network in
.IR notify (3), .IR notify (3),
.IR post9pservice (3), .IR post9pservice (3),
.IR rfork (3), .IR rfork (3),
.IR searchpath (3),
.IR sendfd (3), .IR sendfd (3),
.IR udpread (3), .IR udpread (3),
.IR wait (3), .IR wait (3),

View file

@ -28,6 +28,7 @@
#endif #endif
#undef pipe /* so that /dev/fd works */ #undef pipe /* so that /dev/fd works */
#define searchpath rcsearchpath /* avoid new libc function */
typedef struct tree tree; typedef struct tree tree;
typedef struct word word; typedef struct word word;

View file

@ -100,7 +100,7 @@ void doredir(redir *rp)
word *searchpath(char *w){ word *searchpath(char *w){
word *path; word *path;
if(strncmp(w, "/", 1)==0 if(strncmp(w, "/", 1)==0
|| strncmp(w, "#", 1)==0 /* || strncmp(w, "#", 1)==0 */
|| strncmp(w, "./", 2)==0 || strncmp(w, "./", 2)==0
|| strncmp(w, "../", 3)==0 || strncmp(w, "../", 3)==0
|| (path=vlook("path")->val)==0) || (path=vlook("path")->val)==0)