From owner-freebsd-current Sun Nov 15 03:33:38 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id DAA16782 for freebsd-current-outgoing; Sun, 15 Nov 1998 03:33:38 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from helios.dnttm.ru (dnttm-gw.rssi.ru [193.232.0.205]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id DAA16774 for ; Sun, 15 Nov 1998 03:33:25 -0800 (PST) (envelope-from dima@tejblum.dnttm.rssi.ru) Received: (from uucp@localhost) by helios.dnttm.ru (8.9.1/8.9.1/IP-3) with UUCP id OAA25605; Sun, 15 Nov 1998 14:25:39 +0300 Received: from tejblum.dnttm.rssi.ru (localhost [127.0.0.1]) by tejblum.dnttm.rssi.ru (8.9.1/8.9.1) with ESMTP id OAA02022; Sun, 15 Nov 1998 14:25:00 +0300 (MSK) (envelope-from dima@tejblum.dnttm.rssi.ru) Message-Id: <199811151125.OAA02022@tejblum.dnttm.rssi.ru> X-Mailer: exmh version 2.0gamma 1/27/96 To: Wolfram Schneider cc: current@FreeBSD.ORG Subject: Re: sort option for find In-reply-to: Your message of "Sat, 14 Nov 1998 20:50:02 +0100." <19981114205002.A27346@panke.de.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 15 Nov 1998 14:24:59 +0300 From: Dmitrij Tejblum Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Wolfram Schneider wrote: > +extern int sflag; (This probably should be 'extern int issort;' in extern.h) > + > +/* > + * find_compare -- > + * A function which be used in fts_open() to order the > + * traversal of the hierarchy. > + * This function give you a lexicographical sorted output. > + */ > +static int find_compare(s1, s2) > + const FTSENT **s1, **s2; > +{ > + return strcoll( (*s1)->fts_name, (*s2)->fts_name ); > +} That depends on what do you call "lexicographical order". How do you compare "foo-1.2.3/Makefile" and "foo/Makefile", for example? (Anyhow, strcoll is not supposed to compare in lexicographical order at all. Most implementation don't give lexicographical sorting in non-C locale.). Dima To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message