X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=rmac.c;h=ef190ec0fc959434839d45cfb8a7a2c34ab89f46;hb=b1d365c4672af85701b66b2b4cdeb7ef8dc523a1;hp=2f12bca48293dc6d946e35f274ec78704adb79b9;hpb=1b714ae49d9c9a71bfcbacadd2bf8dab49d67962;p=rmac diff --git a/rmac.c b/rmac.c index 2f12bca..ef190ec 100644 --- a/rmac.c +++ b/rmac.c @@ -101,6 +101,17 @@ char * fext(char * name, char * extension, int stripp) return name; } +static int is_sep(char c) +{ + const char *seps = PATH_SEPS; + + for (seps = PATH_SEPS; *seps; seps++) { + if (*seps == c) + return 1; + } + + return 0; +} // // Return 'item'nth element of semicolon-seperated pathnames specified in the @@ -120,13 +131,13 @@ int nthpath(char * env_var, int itemno, char * buf) return 0; while (itemno--) - while (*s != EOS && *s++ != ';') + while (*s != EOS && !is_sep(*s++)) ; if (*s == EOS) return 0; - while (*s != EOS && *s != ';') + while (*s != EOS && !is_sep(*s)) *buf++ = *s++; *buf++ = EOS;