Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 May 2008 15:30:01 +0400
From:      Eygene Ryabinkin <rea-fbsd@codelabs.ru>
To:        Dmitry Morozovsky <marck@rinet.ru>
Cc:        current@FreeBSD.org
Subject:   Re: tunefs: allowing underscores in file system label
Message-ID:  <AReaFo7ltrtnt1rM3i0QJrG4FAI@hofS/TIRK4jvHER5lUAF55OSKdA>
In-Reply-To: <20080502150037.N40022@woozle.rinet.ru>
References:  <20080502150037.N40022@woozle.rinet.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
Dmitry, good day.

Fri, May 02, 2008 at 03:03:59PM +0400, Dmitry Morozovsky wrote:
> 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
> @@ -139,8 +139,9 @@
>  			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.",

I think that the error message should be changed too: "... Valid
characters are alphanumerics and underscores.".
-- 
Eygene



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AReaFo7ltrtnt1rM3i0QJrG4FAI>