diff options
author | rsc <devnull@localhost> | 2007-05-11 00:20:51 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2007-05-11 00:20:51 +0000 |
commit | 43f16cfa921aabdddf07bc996d8690dd66c1f364 (patch) | |
tree | fc8083e2cafab2afd77537eddcae15242b9dbabb | |
parent | 69bdb78dec6cd3050b5b26764e017a51999e7d14 (diff) | |
download | plan9port-43f16cfa921aabdddf07bc996d8690dd66c1f364.tar.gz plan9port-43f16cfa921aabdddf07bc996d8690dd66c1f364.tar.bz2 plan9port-43f16cfa921aabdddf07bc996d8690dd66c1f364.zip |
again
-rw-r--r-- | src/lib9/_p9dir.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib9/_p9dir.c b/src/lib9/_p9dir.c index 555d20d0..e092b0cf 100644 --- a/src/lib9/_p9dir.c +++ b/src/lib9/_p9dir.c @@ -70,14 +70,16 @@ static int isdisk(struct stat *st) { char *name; - int i; + int i, len; if(!S_ISCHR(st->st_mode)) return 0; name = devname(st->st_rdev, S_IFCHR); - for(i=0; i<nelem(diskdev); i++) - if(strcmp(diskdev[i], name) == 0) + for(i=0; i<nelem(diskdev); i++){ + len = strlen(diskdev[i]); + if(strncmp(diskdev[i], name, len) == 0 && isdigit((uchar)name[len])) return 1; + } return 0; } #endif |