From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2421 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Fix strverscmp Date: Wed, 5 Dec 2012 23:14:56 -0500 Message-ID: <20121206041456.GR20323@brightrain.aerifal.cx> References: <20121205110959.87b6111a.idunham@lavabit.com> <20121205193520.GN20323@brightrain.aerifal.cx> <20121205164329.c5cd3a20.idunham@lavabit.com> <20121206010000.GO20323@brightrain.aerifal.cx> <20121205182101.d997eb6e.idunham@lavabit.com> <20121206022640.GQ20323@brightrain.aerifal.cx> <20121205191819.e83c8c3c.idunham@lavabit.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1354767309 20575 80.91.229.3 (6 Dec 2012 04:15:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Dec 2012 04:15:09 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2422-gllmg-musl=m.gmane.org@lists.openwall.com Thu Dec 06 05:15:22 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1TgSrp-0004Hy-60 for gllmg-musl@plane.gmane.org; Thu, 06 Dec 2012 05:15:21 +0100 Original-Received: (qmail 31905 invoked by uid 550); 6 Dec 2012 04:15:08 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 31897 invoked from network); 6 Dec 2012 04:15:08 -0000 Content-Disposition: inline In-Reply-To: <20121205191819.e83c8c3c.idunham@lavabit.com> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:2421 Archived-At: On Wed, Dec 05, 2012 at 07:18:19PM -0800, Isaac Dunham wrote: > > It can't set the flag unconditionally, only if the previous byte was > > not a digit. Otherwise, non-leading zeros would break handling of > > numeric differences. > Fortunately for us, that appears to be incorrect: > idunham@Caracal:~$ ./a.out jan012 jan0111 > 1 > 1 > idunham@Caracal:~$ ./a.out jan0001 jan001 > -1 > -1 > idunham@Caracal:~$ ./a.out 0001 001 > -1 > -1 > idunham@Caracal:~$ ./a.out 001 0001 > 1 > 1 > idunham@Caracal:~$ ./a.out 0012 00111 > 1 > 1 > idunham@Caracal:~$ ./a.out 00012 00111 > -1 > -1 > idunham@Caracal:~$ ./a.out 00120 00111 > 1 > 1 > > That's testing with the attached version. All that means is that you missed testing any case where it differs. ./a.out s10212 s102102 2 -1 Rich