introduced the string(3L) module

This commit is contained in:
erikb
1986-03-26 16:58:43 +00:00
parent dc106691e0
commit 7c5b41eec7
11 changed files with 184 additions and 39 deletions

View File

@@ -427,12 +427,12 @@ setwdir(wdir, fn)
char *fn, **wdir;
{
register char *p;
char *rindex();
char *strrindex();
p = rindex(fn, '/');
p = strrindex(fn, '/');
while (p && *(p + 1) == '\0') { /* remove trailing /'s */
*p = '\0';
p = rindex(fn, '/');
p = strrindex(fn, '/');
}
if (fn[0] == '\0' || (fn[0] == '/' && p == &fn[0])) /* absolute path */