diff options
Diffstat (limited to 'src')
-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 |