mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
The GETDECIMAL(x) macro in src/cmd/ksh93/features/locale uses a global static variable 'lp' to get the localeconv() results. Several functions in ksh use local variables called 'lp'. It's dumb luck that this hasn't conflicted yet; it's a bug waiting to happen. It's also slightly inefficient as it calls localeconv() every time. In addition there is a redundant 'sh.decomma' flag that is set to 1 if the radix point is a comma, but only once, by sh_init(). It is not updated if the locale changes. That is not correct. This commit gets rid of both and implements a new approach instead: store the radix point in sh.radixpoint at init time in sh_init(), and in the put_lang() locale discipline function, reinitialise sh.radixpoint whenever LC_ALL or LC_NUMERIC changes. The rest of the code can then simply use sh.radixpoint without worry. |
||
|---|---|---|
| .. | ||
| cmds | ||
| dynamic | ||
| externs | ||
| locale | ||
| math.sh | ||
| options | ||
| poll | ||
| rlimits | ||
| setjmp | ||
| sigfeatures | ||
| time | ||
| ttys | ||