about summary refs log tree commit diff
path: root/Src/math.c
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2003-05-12 14:03:26 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2003-05-12 14:03:26 +0000
commit453df705675869123675ba399f08e92ca658aa2f (patch)
tree798f662aa7409f830c84f4bc8897d92f88fe57a6 /Src/math.c
parentfa09beea011a6d5727f917d84dd55bd9f86e5f28 (diff)
downloadzsh-453df705675869123675ba399f08e92ca658aa2f.tar.gz
zsh-453df705675869123675ba399f08e92ca658aa2f.tar.xz
zsh-453df705675869123675ba399f08e92ca658aa2f.zip
merge changes from 4.1
Diffstat (limited to 'Src/math.c')
-rw-r--r--Src/math.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Src/math.c b/Src/math.c
index 6e3fce777..2bf65d117 100644
--- a/Src/math.c
+++ b/Src/math.c
@@ -398,12 +398,12 @@ zzlex(void)
 		    /* it's a float */
 		    yyval.type = MN_FLOAT;
 #ifdef USE_LOCALE
-		    prev_locale = setlocale(LC_NUMERIC, NULL);
+		    prev_locale = dupstring(setlocale(LC_NUMERIC, NULL));
 		    setlocale(LC_NUMERIC, "POSIX");
 #endif
 		    yyval.u.d = strtod(ptr, &nptr);
 #ifdef USE_LOCALE
-		    setlocale(LC_NUMERIC, prev_locale);
+		    if (prev_locale) setlocale(LC_NUMERIC, prev_locale);
 #endif
 		    if (ptr == nptr || *nptr == '.') {
 			zerr("bad floating point constant", NULL, 0);