Skip site navigation (1)Skip section navigation (2)
Date:      4 Feb 1997 01:55:53 -0000
From:      Dan Cross <tenser@spitfire.ecsel.psu.edu>
To:        security@freebsd.org
Subject:   more locale patches...
Message-ID:  <19970204015553.29804.qmail@spitfire.ecsel.psu.edu>

next in thread | raw e-mail | index | archive | help
(NOTE: these patches are for 2.2...)

Here are patches for more locate stuff from 2.2-CURRENT, well, it's not
that current:

: spitfire 1144; uname -a
FreeBSD spitfire.ecsel.psu.edu 2.2-CURRENT FreeBSD 2.2-CURRENT #0: Sat Sep 28
16:39:56 EDT 1996     tenser@spitfire.ecsel.psu.edu:/usr/src/sys/compile/SPIT
FIRE  i386
: spitfire 1145; 

But they might help out nonetheless.  Note that in setlocale.c, the
sections that were changed are enclosed in #if 0's, marked with the
comment, ``someday we might actually use the file.''  :-)  I see no
harm in changing that code now, however, in preperation for the
future.  :-)  Thanks!

	- Dan C.

(btw- I don't guarantee that this fixes every bug in the locale
functions, but, it's a start.  :-)

----- Begin locale.diff
*** collate.c	1997/02/03 23:45:56	1.1
--- collate.c	1997/02/03 23:49:55
***************
*** 71,80 ****
  		return 0;
  	if (!_PathLocale && !(_PathLocale = getenv("PATH_LOCALE")))
  		_PathLocale = _PATH_LOCALE;
! 	strcpy(buf, _PathLocale);
! 	strcat(buf, "/");
! 	strcat(buf, encoding);
! 	strcat(buf, "/LC_COLLATE");
  	if ((fp = fopen(buf, "r")) == NULL) {
  		__collate_load_error = save_load_error;
  		return -1;
--- 71,78 ----
  		return 0;
  	if (!_PathLocale && !(_PathLocale = getenv("PATH_LOCALE")))
  		_PathLocale = _PATH_LOCALE;
! 	(void)snprintf(buf,
! 		PATH_MAX, "%s/%s/LC_COLLATE", _PathLocale, encoding);
  	if ((fp = fopen(buf, "r")) == NULL) {
  		__collate_load_error = save_load_error;
  		return -1;
*** setrunelocale.c	1997/02/03 23:47:15	1.1
--- setrunelocale.c	1997/02/03 23:48:19
***************
*** 86,95 ****
  	if (!_PathLocale && !(_PathLocale = getenv("PATH_LOCALE")))
  		_PathLocale = _PATH_LOCALE;
  
! 	(void) strcpy(name, _PathLocale);
! 	(void) strcat(name, "/");
! 	(void) strcat(name, encoding);
! 	(void) strcat(name, "/LC_CTYPE");
  
  	if ((fp = fopen(name, "r")) == NULL)
  		return(ENOENT);
--- 86,93 ----
  	if (!_PathLocale && !(_PathLocale = getenv("PATH_LOCALE")))
  		_PathLocale = _PATH_LOCALE;
  
! 	(void)snprintf(name,
! 		PATH_MAX, "%s/%s/LC_CTYPE", _PathLocale, encoding);
  
  	if ((fp = fopen(name, "r")) == NULL)
  		return(ENOENT);
----- End locale.diff



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19970204015553.29804.qmail>