]> Savannah Git Hosting - gnulib.git/commitdiff
c32width: protect against bad configure args
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 9 Jul 2023 18:23:58 +0000 (11:23 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 9 Jul 2023 18:24:22 +0000 (11:24 -0700)
Avoid ‘test’ misuse with ‘./configure gt_cv_locale_fr=""’.
Possible problem of this sort reported by Angelo Graziosi in:
https://lists.gnu.org/r/emacs-devel/2023-07/msg00329.html
* m4/locale-fr.m4 (gt_LOCALE_FR_UTF8, gt_LOCALE_FR_UTF8):
* m4/locale-ja.m4 (gt_LOCALE_JA):
* m4/locale-zh.m4 (gt_LOCALE_ZH_CN):
Reject locale names that might cause trouble with sh or make.

ChangeLog
m4/locale-fr.m4
m4/locale-ja.m4
m4/locale-zh.m4

index 476a88c3b5b13a698af83601439c1d681479e7e1..e53c034e634b9955421bd89530e8894811038cd5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2023-07-09  Paul Eggert  <eggert@cs.ucla.edu>
+
+       c32width: protect against bad configure args
+       Avoid ‘test’ misuse with ‘./configure gt_cv_locale_fr=""’.
+       Possible problem of this sort reported by Angelo Graziosi in:
+       https://lists.gnu.org/r/emacs-devel/2023-07/msg00329.html
+       * m4/locale-fr.m4 (gt_LOCALE_FR_UTF8, gt_LOCALE_FR_UTF8):
+       * m4/locale-ja.m4 (gt_LOCALE_JA):
+       * m4/locale-zh.m4 (gt_LOCALE_ZH_CN):
+       Reject locale names that might cause trouble with sh or make.
+
 2023-07-06  Bruno Haible  <bruno@clisp.org>
 
        wcscmp: Work around a glibc bug.
index 107ab931e8306d7421cd676a20810004fce66603..40b13aeaa790562d3472b7782e611994a7fd7159 100644 (file)
@@ -1,4 +1,4 @@
-# locale-fr.m4 serial 21
+# locale-fr.m4 serial 22
 dnl Copyright (C) 2003, 2005-2023 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -133,6 +133,12 @@ int main () {
     rm -fr conftest*
   ])
   LOCALE_FR=$gt_cv_locale_fr
+  case $LOCALE_FR in #(
+    '' | *[[[:space:]\"\$\'*@<:@]]*)
+      dnl This locale name might cause trouble with sh or make.
+      AC_MSG_WARN([invalid locale "$LOCALE_FR"; assuming "none"])
+      LOCALE_FR=none;;
+  esac
   AC_SUBST([LOCALE_FR])
 ])
 
@@ -261,6 +267,12 @@ int main () {
     esac
   ])
   LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
+  case $LOCALE_FR_UTF8 in #(
+    '' | *[[[:space:]\"\$\'*@<:@]]*)
+      dnl This locale name might cause trouble with sh or make.
+      AC_MSG_WARN([invalid locale "$LOCALE_FR_UTF8"; assuming "none"])
+      LOCALE_FR_UTF8=none;;
+  esac
   AC_SUBST([LOCALE_FR_UTF8])
 
   dnl Users of $LOCALE_FR_UTF8 need to know which of the locale categories they
index f6ca327b9411bbb96c302d5936f01757ad753876..a400b75763b0edcfe1cdb8df239b23c1d10eaf71 100644 (file)
@@ -1,4 +1,4 @@
-# locale-ja.m4 serial 16
+# locale-ja.m4 serial 17
 dnl Copyright (C) 2003, 2005-2023 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -139,5 +139,11 @@ int main ()
     rm -fr conftest*
   ])
   LOCALE_JA=$gt_cv_locale_ja
+  case $LOCALE_JA in #(
+    '' | *[[[:space:]\"\$\'*@<:@]]*)
+      dnl This locale name might cause trouble with sh or make.
+      AC_MSG_WARN([invalid locale "$LOCALE_JA"; assuming "none"])
+      LOCALE_JA=none;;
+  esac
   AC_SUBST([LOCALE_JA])
 ])
index 94c545906f2ef4615cb027af56b8c7d458fcce62..8cb7b5e519d28f6d20dd70263640b98ade6683d7 100644 (file)
@@ -1,4 +1,4 @@
-# locale-zh.m4 serial 16
+# locale-zh.m4 serial 17
 dnl Copyright (C) 2003, 2005-2023 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -133,5 +133,11 @@ int main ()
     rm -fr conftest*
   ])
   LOCALE_ZH_CN=$gt_cv_locale_zh_CN
+  case $LOCALE_ZH_CN in #(
+    '' | *[[[:space:]\"\$\'*@<:@]]*)
+      dnl This locale name might cause trouble with sh or make.
+      AC_MSG_WARN([invalid locale "$LOCALE_ZH_CN"; assuming "none"])
+      LOCALE_ZH_CN=none;;
+  esac
   AC_SUBST([LOCALE_ZH_CN])
 ])