diff options
author | julian <julian@FreeBSD.org> | 1996-03-25 21:56:59 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 1996-03-25 21:56:59 +0000 |
commit | eae3c9253f3cfd2661f9304525e82035390da7f7 (patch) | |
tree | 0c309c9828e72f60d6620b0bd1fa884bf73c5920 /sys/miscfs/devfs | |
parent | 444648d45934f6f9ab80b53f0874e0101cf54338 (diff) | |
download | FreeBSD-src-eae3c9253f3cfd2661f9304525e82035390da7f7.zip FreeBSD-src-eae3c9253f3cfd2661f9304525e82035390da7f7.tar.gz |
Submitted by: "Marc G. Fournier" <scrappy@ki.net>
allows correct creation of subdirectories in devfs_add_devswf()
Diffstat (limited to 'sys/miscfs/devfs')
-rw-r--r-- | sys/miscfs/devfs/devfs_tree.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/miscfs/devfs/devfs_tree.c b/sys/miscfs/devfs/devfs_tree.c index e421b2c..a425f87 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.17 1996/01/28 10:07:55 phk Exp $ + * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_tree.c,v 1.18 1996/02/18 07:29:53 julian Exp $ */ #include "param.h" @@ -910,7 +910,7 @@ void *devfs_add_devswf( ...) { va_list ap; - char *p, *q, buf[256]; /* XXX */ + char *p, buf[256]; /* XXX */ int i; va_start(ap, fmt); @@ -918,12 +918,13 @@ void *devfs_add_devswf( va_end(ap); buf[i] = '\0'; p = NULL; - for (q=buf; *q == '/'; q++) - continue; - for (i=0; q[i]; i++) - if (q[i] == '/') - p = q; + for(i=strlen(buf); i>0; i--) + if(buf[i] == '/') { + p=&buf[i]; + buf[i]=0; + break; + } if (p) { *p++ = '\0'; |