From: Ralf Wildenhues Date: Thu, 18 May 2006 06:52:54 +0000 (+0000) Subject: * ltmain.in: Reset/unset not only LANG and LC_ALL, but also X-Git-Tag: release-1-5-23b~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=330a19b1542c7ccb2e8ed9609b246b4d8c016bc2;p=thirdparty%2Flibtool.git * ltmain.in: Reset/unset not only LANG and LC_ALL, but also LC_CTYPE, LC_COLLATE, LC_MESSAGES. (execute mode): Restore them. Noted by Peter O'Gorman. --- diff --git a/ChangeLog b/ChangeLog index f851d923a..07e95d5c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-05-18 Ralf Wildenhues + + * ltmain.in: Reset/unset not only LANG and LC_ALL, but also + LC_CTYPE, LC_COLLATE, LC_MESSAGES. + (execute mode): Restore them. + Noted by Peter O'Gorman. + 2006-05-17 Albert Chin-A-Young * tests/link-order.test: Take hardcode_direct into consideration diff --git a/ltmain.in b/ltmain.in index 4010af05a..3879fb510 100644 --- a/ltmain.in +++ b/ltmain.in @@ -113,12 +113,14 @@ esac # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). # We save the old values to restore during execute mode. -if test "${LC_ALL+set}" = set; then - save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL -fi -if test "${LANG+set}" = set; then - save_LANG="$LANG"; LANG=C; export LANG -fi +for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test \"\${$lt_var+set}\" = set; then + save_$lt_var=\$$lt_var + $lt_var=C + export $lt_var + fi" +done # Make sure IFS has a sensible default lt_nl=' @@ -6464,12 +6466,14 @@ relink_command=\"$relink_command\"" fi # Restore saved environment variables - if test "${save_LC_ALL+set}" = set; then - LC_ALL="$save_LC_ALL"; export LC_ALL - fi - if test "${save_LANG+set}" = set; then - LANG="$save_LANG"; export LANG - fi + for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + else + $lt_unset $lt_var + fi" + done # Now prepare to actually exec the command. exec_cmd="\$cmd$args"