1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00
cde/src/cmd/ksh93/features
Martijn Dekker f0386a8794 Improve radix point (decimal point/comma) handling
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.
2022-06-03 12:16:44 +01:00
..
cmds Add new 'nobackslashctrl' shell option; other minor editor tweaks 2021-02-16 01:29:00 +00:00
dynamic Remove code related to long-dead 3DFS research project 2020-06-12 01:45:17 +02:00
externs INIT: remove proto, ratz (re: 46593a89, 6137b99a); major cleanup 2021-12-24 07:05:22 +00:00
locale Improve radix point (decimal point/comma) handling 2022-06-03 12:16:44 +01:00
math.sh Update copyright years in files changed since 1st Jan 2022 2022-01-30 20:49:04 +00:00
options Yet more misc. cleanups; rm SHOPT_PFSH, SHOPT_TYPEDEF 2022-02-10 21:04:56 +00:00
poll Fix implicit warnings in the iffe feature tests (#396) 2021-12-28 17:50:39 +00:00
rlimits tie up standards macros loose ends (re: 289dd46c) 2022-01-20 05:50:00 +00:00
setjmp Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
sigfeatures Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
time Fix the max precision of the 'time' keyword (#72) 2020-07-14 22:48:04 +01:00
ttys Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00