diff options
author | phk <phk@FreeBSD.org> | 1996-01-28 10:07:55 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1996-01-28 10:07:55 +0000 |
commit | fd7d88027b9ac1a686503364f4e0d8bbeb9a46ef (patch) | |
tree | 7f13236f907fd2fdfe0f26b00b9b84cb1f766921 /sys/miscfs | |
parent | 571dda46ed1369f3e7a14fa255020c2f2b0eb1a0 (diff) | |
download | FreeBSD-src-fd7d88027b9ac1a686503364f4e0d8bbeb9a46ef.zip FreeBSD-src-fd7d88027b9ac1a686503364f4e0d8bbeb9a46ef.tar.gz |
make devfs_add_devswf a little smarter about '/';
Diffstat (limited to 'sys/miscfs')
-rw-r--r-- | sys/miscfs/devfs/devfs_tree.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/miscfs/devfs/devfs_tree.c b/sys/miscfs/devfs/devfs_tree.c index 35a88cc..754e4b6 100644 --- a/sys/miscfs/devfs/devfs_tree.c +++ b/sys/miscfs/devfs/devfs_tree.c @@ -2,7 +2,7 @@ /* * Written by Julian Elischer (julian@DIALix.oz.au) * - * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_tree.c,v 1.15 1996/01/21 09:43:31 julian Exp $ + * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_tree.c,v 1.16 1996/01/25 07:17:31 phk Exp $ */ #include "param.h" @@ -908,7 +908,7 @@ void *devfs_add_devswf( ...) { va_list ap; - char *p, buf[256]; /* XXX */ + char *p, *q, buf[256]; /* XXX */ int i; va_start(ap, fmt); @@ -916,9 +916,13 @@ void *devfs_add_devswf( va_end(ap); buf[i] = '\0'; p = NULL; - for (i=0; buf[i]; i++) - if (buf[i] == '/') - p = buf + 1; + for (q=buf; *q == '/'; q++) + continue; + + for (i=0; q[i]; i++) + if (q[i] == '/') + p = q; + if (p) { *p++ = '\0'; return devfs_add_devsw(buf, p, devsw, minor, chrblk, |