rc: allow colons as separator in $path and $cdpath

This commit is contained in:
Giacomo Tesio 2017-10-18 23:48:42 +02:00
parent 0ef55939e8
commit d33221de34
1 changed files with 6 additions and 0 deletions

View File

@ -144,6 +144,12 @@ Vinit(void)
/* Charitably add a 0 at the end if need be */ /* Charitably add a 0 at the end if need be */
if(buf[len-1]) if(buf[len-1])
buf[len++]='\0'; buf[len++]='\0';
if(strcmp(ENV_PATH, ent[i].name) == 0
|| strcmp(ENV_CDPATH, ent[i].name) == 0)
while(n-- > 0){
if(buf[n] == ':')
buf[n] = '\0';
}
s = buf+len-1; s = buf+len-1;
for(;;){ for(;;){
while(s!=buf && s[-1]!='\0') --s; while(s!=buf && s[-1]!='\0') --s;