summaryrefslogtreecommitdiffhomepage
path: root/e2fsprogs
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-04-06 18:50:05 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-04-06 18:50:05 +0200
commitf8d8aa1cea915ce115345e6e729eddc80e86f021 (patch)
treeabceef94710d221816cf56343b7cadf10de50e5c /e2fsprogs
parent87fb72032e6aa6abe5ac8fb05d22f43e8dde557b (diff)
libbb: add skip_dev_pfx()
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'e2fsprogs')
-rw-r--r--e2fsprogs/fsck.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/e2fsprogs/fsck.c b/e2fsprogs/fsck.c
index 0192f3cdb..7c449e3e7 100644
--- a/e2fsprogs/fsck.c
+++ b/e2fsprogs/fsck.c
@@ -169,12 +169,12 @@ static char *base_device(const char *device)
const char *disk;
int len;
#endif
- cp = str = xstrdup(device);
+ str = xstrdup(device);
- /* Skip over /dev/; if it's not present, give up. */
- if (strncmp(cp, "/dev/", 5) != 0)
+ /* Skip over "/dev/"; if it's not present, give up */
+ cp = skip_dev_pfx(str);
+ if (cp == str)
goto errout;
- cp += 5;
/*
* For md devices, we treat them all as if they were all