From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19292 invoked by alias); 1 Feb 2019 06:55:25 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 19065 invoked by uid 89); 1 Feb 2019 06:55:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.9 required=5.0 tests=BAYES_00,FOREIGN_BODY,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS,T_FILL_THIS_FORM_SHORT autolearn=ham version=3.3.2 spammy=falling, Fax, Phone, our X-HELO: dedi548.your-server.de Received: from dedi548.your-server.de (HELO dedi548.your-server.de) (85.10.215.148) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 01 Feb 2019 06:55:24 +0000 Received: from [78.46.172.3] (helo=sslproxy06.your-server.de) by dedi548.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1gpSjS-0005PU-Ig for newlib@sourceware.org; Fri, 01 Feb 2019 07:55:22 +0100 Received: from [82.135.62.35] (helo=mail.embedded-brains.de) by sslproxy06.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1gpSjS-000Mv9-Cy for newlib@sourceware.org; Fri, 01 Feb 2019 07:55:22 +0100 Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 391232A0043 for ; Fri, 1 Feb 2019 07:55:34 +0100 (CET) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 7Mu6s8m_S1wS for ; Fri, 1 Feb 2019 07:55:33 +0100 (CET) Received: from localhost (localhost.localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id D83A72A0928 for ; Fri, 1 Feb 2019 07:55:33 +0100 (CET) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id n_9BYSdM-4iJ for ; Fri, 1 Feb 2019 07:55:33 +0100 (CET) Received: from huber-nb-linux.suse (unknown [192.168.96.161]) by mail.embedded-brains.de (Postfix) with ESMTPSA id C7CB32A0043 for ; Fri, 1 Feb 2019 07:55:33 +0100 (CET) Subject: Re: [PATCH 7/8] a) Use strcoll() in opendir() and alphasort() From: Sebastian Huber To: newlib@sourceware.org References: <20190131130552.30426-1-sebastian.huber@embedded-brains.de> <20190131130552.30426-8-sebastian.huber@embedded-brains.de> Message-ID: <004c2e38-648b-a13e-9c26-a31bd6ebc84a@embedded-brains.de> Date: Fri, 01 Feb 2019 06:55:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <20190131130552.30426-8-sebastian.huber@embedded-brains.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2019/txt/msg00045.txt.bz2 On 31/01/2019 14:05, Sebastian Huber wrote: > From: ache > > as POSIX 2008 requires. It also matches now how our 'ls' works for years. > > b) Remove comment expressed 2 fears: > 1) One just simple describe how strcoll() works in _any_ context, > not for directories only. Are we plan to remove strcoll() from everythi= ng > just because it is little more complex than strcmp()? I doubt, and > directories give nothing different here. Moreover, strcoll() used > in 'ls' for years and nobody complaints yet. > > 2) Plain wrong statement about undefined strcoll() behaviour. strcoll() > always gives predictable results, falling back to strcmp() on any > trouble, see strcoll(3). > > No objections from -current list discussion. > --- > newlib/libc/posix/scandir.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/newlib/libc/posix/scandir.c b/newlib/libc/posix/scandir.c > index 94c583761..13354c05e 100644 > --- a/newlib/libc/posix/scandir.c > +++ b/newlib/libc/posix/scandir.c > @@ -142,12 +142,13 @@ fail: >=20=20=20 > /* > * Alphabetic order comparison routine for those who want it. > + * POSIX 2008 requires that alphasort() uses strcoll(). > */ > int > -alphasort (const struct dirent **d1, > - const struct dirent **d2) > +alphasort(const struct dirent **d1, const struct dirent **d2) > { > - return(strcmp((*d1)->d_name, (*d2)->d_name)); > + > + return (strcoll((*d1)->d_name, (*d2)->d_name)); > } >=20=20=20 > #endif /* ! HAVE_OPENDIR */ After looking into newlib/libc/string/strcoll.c, this patch makes no=20 sense. I will not apply it. --=20 Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-82178 Puchheim, Germany Phone : +49 89 189 47 41-16 Fax : +49 89 189 47 41-09 E-Mail : sebastian.huber@embedded-brains.de PGP : Public key available on request. Diese Nachricht ist keine gesch=C3=A4ftliche Mitteilung im Sinne des EHUG.