Commit Graph

170 Commits

Author SHA1 Message Date
enami 8be6c4876d Rearrange code to avoid core dump and just return an error instead
when parsing a locale string previously returned by setlocale.
2002-08-07 04:42:42 +00:00
yamt e499009646 remove _StreamStateTable. 2002-08-03 11:10:51 +00:00
yamt 88a7c37398 remove a global variable "saved_categories" as it isn't necessary anymore. 2002-08-03 06:12:30 +00:00
tshiozak 0b03f5f98b remove an obstructive ?: operator of the check added in the last commit by
itojun-san.
2002-08-02 12:27:32 +00:00
itojun 73811081f9 correct use of strlcpy (really need to enforce length, so use memcpy) 2002-08-02 08:02:36 +00:00
tshiozak 19debadf5c fix a bug of setlocale when changing locales with LC_ALL for the first
argunemt and with a string containing many slashes for the second argument.
This bug may cause setlocale() to destroy static datas.

If a setuid program calls this function as 'setlocale(LC_ALL, "");',
this might be vulnerable, although there are few programs having such
vulnerability.  This bug probably affects every versions of NetBSD,
including 1.4, 1.5 and 1.6.

XXX: This part of setlocale is unseemly, thus we had better rewrite it in
the future.
2002-08-02 07:12:51 +00:00
yamt 38b935dc19 add CAVEATS. 2002-07-10 14:46:10 +00:00
yamt 67eaaa4e49 BUGS:
Multibyte locales aren't supported for static binaries.
2002-05-19 13:44:31 +00:00
kleink 3e9bbb1219 Need namespace.h for snprintf. 2002-04-17 13:40:35 +00:00
wiz 29a3d37fd5 Add HISTORY. 2002-04-09 20:00:05 +00:00
yamt 764625531c remove a redundant space. 2002-03-27 18:17:34 +00:00
yamt 8468b78b76 move mbrtowc to _amd1 from _c90. 2002-03-26 06:10:27 +00:00
yamt bf790e3b07 return value 0 doesn't have special meanings. 2002-03-25 20:01:22 +00:00
yamt 88fef345a8 return value 0 doesn't have any special meanings. 2002-03-25 19:22:13 +00:00
yamt de5444e862 - return value 0 doesn't have special meanings for wcsrtombs.
- add a note about terminating null byte for s == NULL case.
- s/null byte/null wide character/ in some place.
2002-03-25 19:17:02 +00:00
tshiozak f4b38752de Move mbstate_t materials from locale/runetype.h to locale/multibyte.h.
Before this fix, building nbmklocale was failed on non-NetBSD-current platforms.
multibyte.h seems more appropriate one to contain them.
2002-03-18 22:58:44 +00:00
yamt 69fa98c2af explicitly align _RuneStatePriv::__private
and remove XXX comment.
2002-03-18 22:25:43 +00:00
yamt 597ba8fdc1 - check malloc failure.
- only 'next' member of global variable localetable is used.
  so remove it and define a pointer instead.
2002-03-18 11:49:19 +00:00
yamt 6c2e3b3d83 fix how to check a return value of readentry. 2002-03-18 11:34:40 +00:00
yamt 4112ebb394 set errno only when error occured. 2002-03-18 09:56:49 +00:00
wiz 8d3b0e0097 Use .St -isoC99 to refer to ISO C99. 2002-03-18 08:03:39 +00:00
wiz 68dbdc566f HTML-quote another <> pair. 2002-03-18 08:02:19 +00:00
wiz 9f64fab4a1 Fix .Dd argument, sort SEE ALSO, remove trailing dot in SEE ALSO,
HTML-quote <>, and fix some typos.
2002-03-18 07:56:28 +00:00
tshiozak 8625ada82c add manpages for mb*/wc* functions. 2002-03-18 06:00:26 +00:00
tshiozak dc7d18ff88 refine i18n stuffs.
- add libc/citrus directory.
    this directory contains the common stuffs not only for locale
    but also other facilities relating to i18n (e.g. iconv).
  - To keep the binary compatibility for the ctype modules easily,
    the interface between libc and the modules is simplified.
  - For the future integrated extension, module pool is renamed
    from "/usr/lib/runemodule" to "/usr/lib/i18n".
    In the future, this directory will contain the modules for "iconv",
    "collation", etc.
  - some cosmetic changes.
  - Bug fix for runetype.h; __attribute__((__packed__)) is placed at
    the wrong position and it is invalid unintentionally.
    But, the all members of the structures seem well-aligned.  Thus,
    this bug causes no problem, hopefully.

HEADS UP:
  - /usr/lib/rumemodule is obsoleted.  If you use the multibyte locales,
    you need to install /usr/lib/i18n/* from sys/lib/i18n_module .
  - The binary compatibility of /usr/share/locale/*/LC_CTYPE is probably kept.
    Perhaps, the bug fix about __packed__ mentioned above breaks the
    compatibility...  Be careful especially on 64bit platforms.
2002-03-17 22:14:05 +00:00
yamt 5d6c7fdf83 wcwidth's argument is wchar_t. not wint_t. 2002-03-14 21:18:46 +00:00
yamt 9ddf6eb6f6 - give the precedence to LC_ALL environment variable
than other LC_* variables.
- add a hack for LC_MESSAGES for nls.
  (this will be removed when we have a real LC_MESSAGES support.)
2002-02-13 07:59:45 +00:00
yamt 48e0f9a85a add a function to handle alias names.
(primarily for nls, encoding and locale names)
2002-02-13 07:45:52 +00:00
ross 814f296b77 Generate <>& symbolically. 2002-02-07 07:00:09 +00:00
yamt 9827e287a7 fix a long standing bug that setlocale(LC_ALL, NULL)
returns only 5 categories while we have 6 categories.
2002-01-22 17:08:02 +00:00
yamt 9de0432262 remove #if define(lint).
we don't need it anymore since lint has been fixed.
2001-10-28 12:08:43 +00:00
jmc 5e189cb036 Convert to using standard headers/types for values within here.
Wrap the RuneState struct so it only gets visibity to the library compiles
(userland tools such as mklocale don't need to set/get states)
2001-10-20 06:01:13 +00:00
jmc 1919be32df Change the magic -3 for the invalid rune to
#define _DEFAULT_INVALID_RUNE -3

and use it accordingly. Also provides a representation programs such as
mklocale can reference when filling out a new locale from a definition.
2001-10-20 05:59:35 +00:00
yamt 7368604c8e - mblen and mbtowc shouldn't return -2.
- non-restartable functions shouldn't be restartable.
2001-10-09 10:21:48 +00:00
erh b0ed71fe70 Include string.h to get memset prototype. 2001-10-02 01:20:03 +00:00
yamt 1628acde4a add a header used by wcstoul/wcstol.
i forgot it at last commit.
2001-09-28 11:25:37 +00:00
yamt 6eb1cbbb9b fix type in comment 2001-09-28 09:29:17 +00:00
yamt a9c5a86aa9 add wcstod/wcstol/wcstoul. 2001-09-27 16:30:35 +00:00
wiz 58329ea2bf Remove some boring whitespace and fix a section header. 2001-09-16 02:25:37 +00:00
yamt 1aa18a915f update comments 2001-06-22 00:01:47 +00:00
yamt b12809f15e linted. 2001-06-21 19:37:06 +00:00
yamt d14a2355eb sync with latest Citrus XPG4DL.
- mbsrtowcs/wcsrtombs
	- when conversion stopped with terminating-null, set *src null-pointer.
	- if dst isn't null, ignore len.
	- fix how to treat ___mbrtowc
- mbrtowc
	- fix problem that terminating null charactor wasn't stored.
	- fix problem with stateful encoding.
		(when src points to escape sequence + '\0', mbstate wasn't initialized)
	- fix return value when restarted.
		XXX euctw and big5 are not tested.
- iso2022-jp
	- fix mbrtowc with imcomplete sequence.
- etc
	- make sure mbstate is initialized. (___rune_initstate is called)
		primarily to fix mbsinit for iso2022.
	- sync citrus Id
2001-06-21 02:20:24 +00:00
uwe 06f9773006 Unbalanced quote in RETURN VALUES section header. 2001-06-06 22:47:34 +00:00
kleink 6d12e22df8 C89/AMD1: mbsrtowcs() and wcsrtombs() are not to return the terminating
null; also correct the corresponding conversion loop exit in mbsrtowcs().
From YAMAMOTO Takashi in PR lib/13016.
2001-05-26 13:18:42 +00:00
kristerw 13aabc248d Make sure that we don't free() through an uninitialized pointer in error
handling code.
2001-05-26 00:35:20 +00:00
kleink 08c6392504 Need <limits.h> in _CTYPE_PRIVATE environments. 2001-04-17 20:12:31 +00:00
kleink 232fcc90e3 isoC -> isoC90. 2001-04-14 17:13:23 +00:00
tshiozak 9d67eaba15 Remove UTF-2. UTF-2 is superceded by UTF-8. 2001-04-01 17:45:39 +00:00
tshiozak 0c95c16c79 Remove UTF-2. UTF-2 is superceded by UTF-8.
see also:
http://mail-index.netbsd.org/tech-userlevel/2001/03/30/0000.html
http://mail-index.netbsd.org/tech-userlevel/2001/03/30/0001.html
http://mail-index.netbsd.org/tech-userlevel/2001/03/30/0002.html
2001-04-01 17:43:07 +00:00
tshiozak 636743250b fix a bit bug. this bug normally causes no problem. 2001-03-26 20:06:46 +00:00