Subject: Re: NetBSD master CVS tree commits
To: None <christos@NetBSD.ORG>
From: None <Chris_G_Demetriou@NIAGARA.NECTAR.CS.CMU.EDU>
List: tech-kern
Date: 02/07/1996 13:47:55
> christos
> Tue Feb  6 16:22:03 EST 1996
> Update of /a/cvsroot/src/sys/lib/libkern
> In directory pain.lcs.mit.edu:/b/tmp/cvs-serv3818
> 
> Added Files:
> 	strncasecmp.c 
> Log Message:
> Add strncasecmp.c; extracted from ADOSFS adlookup.c.

It's not clear that this is appropriate.

In particlar, different file systems have different heuristics as to
what "toupper()" and "tolower()" of certain characters is, and they're
certainly different than the one used by 'C', or in ASCII.

It seems to me that there are two ways to go here:
	(1) each file system which is case-insensitive should have its
	    own comparison routine, that mimics the native OS's
	    definition of case mappings for 'weird' characters, or
	(2) if there is one 'global' comparison routine, it should
	    understand different locales, etc., so that people can
	    at least set what they think is the appropriate
	    translation.

it seems to me that using one 'standard' strncasecmp is both
US-centric, and _wrong_.  (The latter, because it doesn't properly
mimic what the native file system would do to deal with case
comparison.)

I don't really think that it's possible or reasonable to make the
kernel understand locales, but i _do_ think that if you're going to
mimic support for case-insensitive file names, you should at least use
the same lower<->upper mappings that the native file system used.
(if you don't, then it seems to me that data files on those file
systems which reference other files on those file systems could
possibly not end up talking about the right files...)



chris