]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
(AS_SHELL_SANITIZE): Unset ENV, MAIL,
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 1 Sep 2002 08:24:04 +0000 (08:24 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 1 Sep 2002 08:24:04 +0000 (08:24 +0000)
MAILPATH and set PS1, PS2, PS4 to default values, to work
around bug in pre-3.0 UWIN ksh reported by Bruce Lilly.
For LC_ALL etc, first try to set to "C" as POSIX requires and as
the Autoconf documentation specifies; fall back to "unset" only if
this fails.  Use a shell for-loop for this rather than an m4 loop,
to shorten the output script.

lib/m4sugar/m4sh.m4

index 13d75a4f87b1025d4958376b9d37eb4038fd82ba..fa2994a56a3c32c8ed261ed88df7f9fe3189769d 100644 (file)
@@ -153,14 +153,23 @@ elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
   set -o posix
 fi
 
-# NLS nuisances.
 _AS_UNSET_PREPARE
-m4_foreach([_AS_var],
-  [LANG, LC_ALL, LC_TIME, LC_CTYPE, LANGUAGE,
-   LC_COLLATE, LC_NUMERIC, LC_MESSAGES],
-  [(set +x; test -n "`(_AS_var=C; export _AS_var) 2>&1`") &&
-    { AS_UNSET(_AS_var, C); }
-])
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in LANG LANGUAGE LC_ALL LC_COLLATE LC_CTYPE LC_NUMERIC LC_MESSAGES LC_TIME
+do
+  if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
 
 # Required to use basename.
 _AS_EXPR_PREPARE