From owner-svn-src-all@freebsd.org Wed Jul 15 09:29:06 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13D6F9A1096; Wed, 15 Jul 2015 09:29:06 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cloud.theravensnest.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CE2BA1EA5; Wed, 15 Jul 2015 09:29:05 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from user-109-13.vpn.cl.cam.ac.uk (user-109-13.vpn.cl.cam.ac.uk [128.232.109.13]) (authenticated bits=0) by theravensnest.org (8.15.1/8.15.1) with ESMTPSA id t6F9SoY9041785 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 15 Jul 2015 09:28:51 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Subject: Re: svn commit: r285552 - head/usr.bin/xargs From: David Chisnall In-Reply-To: <55A5A30F.4070005@delphij.net> Date: Wed, 15 Jul 2015 10:29:22 +0100 Cc: Ian Lepore , Garrett Cooper , Baptiste Daroussin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201507141916.t6EJGEG1083928@repo.freebsd.org> <48222CD1-7087-4C9A-A586-71F6A37A601C@gmail.com> <55A574BA.4090700@delphij.net> <1436912270.1334.309.camel@freebsd.org> <55A5A30F.4070005@delphij.net> To: d@delphij.net X-Mailer: Apple Mail (2.2098) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jul 2015 09:29:06 -0000 On 15 Jul 2015, at 01:02, Xin Li wrote: >=20 > My only concern with strtonum() is that it's English only. Given that strtonum() wraps strtoll, it ought to support whatever the = current locale is (assuming that the program calls setlocale() before = calling strtonum(), otherwise it will use the C locale[1]). Or do you = mean that the error messages are not localised? David [1] I would strongly advise against calling strtonum() or strtoll(), = rather than strtoll_l() from a library, as it is impossible to specify = in a potentially multi-threaded context whether you=92re currently using = a human-friendly or a machine-friendly number representation. In a = single-threaded application, it=92s probably fine as long as *all* of = your number parsing is either from a user or from a machine-parsable = file (and all of your output is similar, or you=92re explicitly setting = the locale before each call). Given that strtonum() is non-standard = anyway, we should probably add a strtonum_l() that takes a locale_t and = a number base.=