fdisk: remove "devfs kludge"
function old new delta partname 184 136 -48 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
1 parent
03293bc06c
commit
25c50c4805
1 file changed
+3
-12
+3
-12
@@ -571,22 +571,13 @@ partname(const char *dev, int pno, int lth)
|
||||
|
||||
w = strlen(dev);
|
||||
p = "";
|
||||
|
||||
if (isdigit(dev[w-1]))
|
||||
if (isdigit(dev[w - 1]))
|
||||
p = "p";
|
||||
|
||||
/* devfs kludge - note: fdisk partition names are not supposed
|
||||
to equal kernel names, so there is no reason to do this */
|
||||
if (strcmp(dev + w - 4, "disc") == 0) {
|
||||
w -= 4;
|
||||
p = "part";
|
||||
}
|
||||
|
||||
wp = strlen(p);
|
||||
wp = (p[0] != '\0'); //=strlen(p)
|
||||
|
||||
if (lth) {
|
||||
snprintf(bufp, bufsiz, "%*.*s%s%-2u",
|
||||
lth-wp-2, w, dev, p, pno);
|
||||
lth - wp - 2, w, dev, p, pno);
|
||||
} else {
|
||||
snprintf(bufp, bufsiz, "%.*s%s%-2u", w, dev, p, pno);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user