From thomas@laurel.tmseck.homedns.org  Fri Jul 11 10:40:49 2003
Return-Path: <thomas@laurel.tmseck.homedns.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 17CC537B401
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 11 Jul 2003 10:40:49 -0700 (PDT)
Received: from smtp1.netcologne.de (smtp1.netcologne.de [194.8.194.112])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 75CBA43FB1
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 11 Jul 2003 10:40:48 -0700 (PDT)
	(envelope-from thomas@laurel.tmseck.homedns.org)
Received: from laurel.tmseck.homedns.org (xdsl-213-168-108-173.netcologne.de [213.168.108.173])
	by smtp1.netcologne.de (Postfix) with SMTP id E099A388F7
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 11 Jul 2003 19:40:44 +0200 (MEST)
Received: (qmail 1522 invoked by uid 1001); 11 Jul 2003 17:41:02 -0000
Message-Id: <20030711174102.1521.qmail@laurel.tmseck.homedns.org>
Date: 11 Jul 2003 17:41:02 -0000
From: Thomas Seck <tmseck@netcologne.de>
Reply-To: Thomas Seck <tmseck@netcologne.de>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Document that glob(3) respects LC_COLLATE
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         54391
>Category:       docs
>Synopsis:       Document that glob(3) respects LC_COLLATE
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-doc
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 11 10:50:14 PDT 2003
>Closed-Date:    Wed Sep 01 11:06:17 GMT 2004
>Last-Modified:  Wed Sep 01 11:06:17 GMT 2004
>Originator:     Thomas Seck
>Release:        FreeBSD HEAD as of July 11, 2003
>Organization:
>Environment:
FreeBSD 4-STABLE

	
>Description:
	glob(3)'s description of GLOB_NOSORT claims that glob(3) always
	sorts in alphabetical order as specified by ASCII.
	This is not true if LC_COLLATE (or LANG, resp.) are set.
>How-To-Repeat:
	Create the files a.test, b.test and <aumlaut>.test with <aumlaut>
	being the "a with dots" present in ISO8859-1.
	Then compare the output of
	env LC_COLLATE=en_US.US-ASCII ls *.test
	(<aumlaut>.test ist sorted last)
	with
	env LC_COLLATE=en_US.ISO8859-1 ls *.test
	(<aumlaut is sorted between a and b).
>Fix:
	Reword glob(3) like this:

	Index: glob.3
	===================================================================
	RCS file: /home/ncvs/src/lib/libc/gen/glob.3,v
	retrieving revision 1.23
	diff -u -r1.23 glob.3
	--- glob.3	4 Feb 2003 16:27:42 -0000	1.23
	+++ glob.3	11 Jul 2003 17:05:58 -0000
	@@ -197,10 +197,10 @@
	 .Dv GLOB_NOESCAPE
	 is set, backslash escaping is disabled.
	 .It Dv GLOB_NOSORT
	-By default, the pathnames are sorted in ascending
	-.Tn ASCII
	-order;
	-this flag prevents that sorting (speeding up
	+By default, the pathnames are sorted in locale specific ascending order
	+as specified by
	+.Ev LC_COLLATE .
	+This flag prevents that sorting (speeding up
	 .Fn glob ) .
	 .El
	 .Pp
	@@ -421,7 +421,8 @@
	 .Sh SEE ALSO
	 .Xr sh 1 ,
	 .Xr fnmatch 3 ,
	-.Xr regexp 3
	+.Xr regexp 3 ,
	+.Xr setlocale 3
	 .Sh STANDARDS
	 The
	 .Fn glob


>Release-Note:
>Audit-Trail:

From: Tom Rhodes <trhodes@FreeBSD.org>
To: Thomas Seck <tmseck@netcologne.de>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: docs/54391: Document that glob(3) respects LC_COLLATE
Date: Fri, 11 Jul 2003 13:50:47 -0400

 On 11 Jul 2003 17:41:02 -0000
 Thomas Seck <tmseck@netcologne.de> wrote:
 
 > 
 > 	Index: glob.3
 > 	===================================================================
 > 	RCS file: /home/ncvs/src/lib/libc/gen/glob.3,v
 > 	retrieving revision 1.23
 > 	diff -u -r1.23 glob.3
 > 	--- glob.3	4 Feb 2003 16:27:42 -0000	1.23
 > 	+++ glob.3	11 Jul 2003 17:05:58 -0000
 > 	@@ -197,10 +197,10 @@
 > 	 .Dv GLOB_NOESCAPE
 > 	 is set, backslash escaping is disabled.
 > 	 .It Dv GLOB_NOSORT
 > 	-By default, the pathnames are sorted in ascending
 > 	-.Tn ASCII
 > 	-order;
 > 	-this flag prevents that sorting (speeding up
 > 	+By default, the pathnames are sorted in locale specific ascending order
 
 
 "sorted by locale in ascending order"?
 
 
 --
 Tom Rhodes

From: Thomas Seck <tmseck@netcologne.de>
To: Tom Rhodes <trhodes@FreeBSD.org>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: docs/54391: Document that glob(3) respects LC_COLLATE
Date: Fri, 11 Jul 2003 20:20:44 +0200

 * Tom Rhodes (trhodes@FreeBSD.org):
 
 > On 11 Jul 2003 17:41:02 -0000
 > Thomas Seck <tmseck@netcologne.de> wrote:
 > 
 > > 
 > > 	+By default, the pathnames are sorted in locale specific ascending order
 > 
 > 
 > "sorted by locale in ascending order"?
 
 Hm, I am not a native speaker but this does not sound right to me. SUSv3
 uses "...according to the current setting of the LC_COLLATE
 category..." and it is qsort(3) that actually does the sorting. But I
 admit that my suggestion sounds a bit awkward.
 
 Regards,
 -- 
 Thomas Seck
State-Changed-From-To: open->patched 
State-Changed-By: tjr 
State-Changed-When: Mon Aug 23 12:11:26 GMT 2004 
State-Changed-Why:  
A similar patch has been committed to -current and will be MFC'd in 7 days. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=54391 
State-Changed-From-To: patched->closed 
State-Changed-By: tjr 
State-Changed-When: Wed Sep 1 11:03:53 GMT 2004 
State-Changed-Why:  
glob() does not actually respect LC_COLLATE, and the change to the manual 
page has been backed out in -current. Your shell must not be using glob() 
from libc. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=54391 
>Unformatted:
