tunefs: allowing underscores in file system label

From: Dmitry Morozovsky <marck_at_rinet.ru>
Date: Fri, 2 May 2008 15:03:59 +0400 (MSD)
Dear colleagues,

any objection to the following simple patch? It would help using glabel be a 
bit more consistent, as many msdosfs labels contain underscores.

Index: tunefs.c
===================================================================
RCS file: /home/ncvs/src/sbin/tunefs/tunefs.c,v
retrieving revision 1.42
diff -u -r1.42 tunefs.c
--- tunefs.c	9 Apr 2004 19:58:40 -0000	1.42
+++ tunefs.c	2 May 2008 11:00:24 -0000
_at__at_ -139,8 +139,9 _at__at_
 			found_arg = 1;
 			name = "volume label";
 			Lvalue = optarg;
-			i = -1;
-			while (isalnum(Lvalue[++i]));
+			i = 0;
+			while (isalnum(Lvalue[i]) || Lvalue[i] == '_')
+				i++;
 			if (Lvalue[i] != '\0') {
 				errx(10,
 				"bad %s. Valid characters are alphanumerics.",

Sincerely,
D.Marck                                     [DM5020, MCK-RIPE, DM3-RIPN]
[ FreeBSD committer:                                 marck_at_FreeBSD.org ]
------------------------------------------------------------------------
*** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck_at_rinet.ru ***
------------------------------------------------------------------------
Received on Fri May 02 2008 - 09:04:02 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:30 UTC