From aeb2785c30e1f4593c052954d7ca53d5124f006c Mon Sep 17 00:00:00 2001 From: Kirk McKusick Date: Tue, 20 Jun 2017 21:26:42 +0000 Subject: [PATCH] Allow '_' in labels when specifying -L to newfs. Reported by: Keve Nagy Reviewed by: kib PR: 220163 MFC after: 5 days --- sbin/newfs/newfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c index 000e03add4ca..8b32792c3c83 100644 --- a/sbin/newfs/newfs.c +++ b/sbin/newfs/newfs.c @@ -150,7 +150,8 @@ main(int argc, char *argv[]) case 'L': volumelabel = optarg; i = -1; - while (isalnum(volumelabel[++i])); + while (isalnum(volumelabel[++i]) || + volumelabel[i] == '_'); if (volumelabel[i] != '\0') { errx(1, "bad volume label. Valid characters are alphanumerics."); }