From owner-freebsd-current@FreeBSD.ORG Fri May 2 11:41:07 2008 Return-Path: Delivered-To: current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DD42106568C for ; Fri, 2 May 2008 11:41:07 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) Received: from 0.mx.codelabs.ru (0.mx.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id 3EB778FC17 for ; Fri, 2 May 2008 11:41:07 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) DomainKey-Signature: a=rsa-sha1; q=dns; c=simple; s=one; d=codelabs.ru; h=Received:Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:Sender; b=aFI+mZ99GLKXTXuoIPccOoKPAXsgdqmDbTsX7g7Dt2us5Q88R2Ln8fEBwwD643MqY59zRm90vYdc2bFjvV2dIvEhgQBGxnmF1DWmJQCApZ/M2rjaflklcBMrZoVvfezaUAGeoIUkT7HTBoj162sRsiBXH1T2zbYaQHD01e/ijpg=; Received: from void.codelabs.ru (void.codelabs.ru [144.206.177.25]) by 0.mx.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1JrtSl-000ASx-0N; Fri, 02 May 2008 15:30:03 +0400 Date: Fri, 2 May 2008 15:30:01 +0400 From: Eygene Ryabinkin To: Dmitry Morozovsky Message-ID: References: <20080502150037.N40022@woozle.rinet.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20080502150037.N40022@woozle.rinet.ru> Sender: rea-fbsd@codelabs.ru Cc: current@FreeBSD.org Subject: Re: tunefs: allowing underscores in file system label X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2008 11:41:07 -0000 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