aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtests/blkid.test2
-rw-r--r--toys/other/blkid.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/blkid.test b/tests/blkid.test
index d3bf6a1f..deb94d89 100755
--- a/tests/blkid.test
+++ b/tests/blkid.test
@@ -22,7 +22,7 @@ testing "ext4" 'bzcat "$BDIR"/ext4.bz2 | blkid -' \
'-: LABEL="myext4" UUID="dc4b7c00-c0c0-4600-af7e-0335f09770fa" TYPE="ext4"\n' \
"" ""
testing "f2fs" 'bzcat "$BDIR"/f2fs.bz2 | blkid -' \
- '-: LABEL="" UUID="b53d3619-c204-4c0b-8504-36363578491c" TYPE="f2fs"\n' \
+ '-: UUID="b53d3619-c204-4c0b-8504-36363578491c" TYPE="f2fs"\n' \
"" ""
testing "msdos" 'bzcat "$BDIR"/msdos.bz2 | blkid -' \
'-: LABEL="mymsdos" UUID="5108-1e6e" TYPE="vfat"\n' "" ""
diff --git a/toys/other/blkid.c b/toys/other/blkid.c
index 04c9b5f0..ee3564cf 100644
--- a/toys/other/blkid.c
+++ b/toys/other/blkid.c
@@ -116,14 +116,14 @@ static void do_blkid(int fd, char *name)
printf("%s:",name);
if (fstypes[i].label_len) {
- char *s = toybuf+fstypes[i].label_off-off;;
+ char *s = toybuf+fstypes[i].label_off-off;
len = fstypes[i].label_len;
if (!strcmp(type, "vfat")) {
while (len && s[len-1]==' ') len--;
if (strstart(&s, "NO NAME")) len=0;
}
- if (len) printf(" LABEL=\"%.*s\"", len, s);
+ if (len && *s) printf(" LABEL=\"%.*s\"", len, s);
}
if (fstypes[i].uuid_off) {