]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Fix ${VAR-NONWORD} bugs
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 17 Jul 2020 00:35:36 +0000 (17:35 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 17 Jul 2020 06:08:10 +0000 (23:08 -0700)
* lib/autoconf/functions.m4 (AC_FUNC_SELECT_ARGTYPES):
* lib/autoconf/programs.m4 (AC_FUNC_SELECT_ARGTYPES):
* lib/autotest/general.m4 (AT_INIT):
Rewrite to avoid ${VAR-VALUE} where VALUE is not a shell word.

lib/autoconf/functions.m4
lib/autoconf/programs.m4
lib/autotest/general.m4

index 645a7c60526cb64b00cc8bbbb245bb59473b06b4..718503f5bb37e52a89dba73a04080958ddf8f7de 100644 (file)
@@ -1526,7 +1526,8 @@ AC_DEFUN([AC_FUNC_SELECT_ARGTYPES],
 [AC_CHECK_HEADERS_ONCE([sys/select.h sys/socket.h])
 AC_CACHE_CHECK([types of arguments for select],
 [ac_cv_func_select_args],
-[for ac_arg234 in 'fd_set *' 'int *' 'void *'; do
+[ac_cv_func_select_args='int,int *,struct timeval *'
+for ac_arg234 in 'fd_set *' 'int *' 'void *'; do
  for ac_arg1 in 'int' 'size_t' 'unsigned long int' 'unsigned int'; do
   for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do
    AC_COMPILE_IFELSE(
@@ -1546,8 +1547,6 @@ AC_CACHE_CHECK([types of arguments for select],
   done
  done
 done
-# Provide a safe default value.
-: "${ac_cv_func_select_args=int,int *,struct timeval *}"
 ])
 ac_save_IFS=$IFS; IFS=','
 set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'`
index 087c913aa0169eb9db89b7247839463202f0ce06..0ad3ddd1db35d8f78b7ae93f32262672594ba942 100644 (file)
@@ -760,13 +760,15 @@ AC_SUBST([LEX_OUTPUT_ROOT], [$ac_cv_prog_lex_root])dnl
 
 AS_VAR_SET_IF([LEXLIB], [], [
   AC_CACHE_CHECK([for lex library], [ac_cv_lib_lex], [
-    ac_cv_lib_lex='not found'
     ac_save_LIBS=$LIBS
-    for ac_lib in '' -lfl -ll; do
-      LIBS="$ac_lib $ac_save_LIBS"
+    for ac_cv_lib_lex in 'none needed' -lfl -ll 'not found'; do
+      case $ac_cv_lib_lex in
+       'none needed') ;;
+       'not found') break;;
+       *) LIBS="$ac_cv_lib_lex $ac_save_LIBS";;
+      esac
       AC_LINK_IFELSE([AC_LANG_DEFINES_PROVIDED[`cat $LEX_OUTPUT_ROOT.c`]],
-       [ac_cv_lib_lex="${ac_lib:-none needed}"
-         break])
+       [break])
     done
     LIBS=$ac_save_LIBS
   ])
index 5d89d0c06937b99c8a8f31bfa40be48594acdbda..6a6d1a47bacecf7c6b44fda590df6f996e33c111 100644 (file)
@@ -1642,12 +1642,15 @@ else
   else
     at_msg="\`${at_testdir+${at_testdir}/}$as_me.log'"
   fi
+  at_msg1a=${at_xpass_list:+', '}
+  at_msg1=$at_fail_list${at_fail_list:+" failed$at_msg1a"}
+  at_msg2=$at_xpass_list${at_xpass_list:+" passed unexpectedly"}
+
   AS_ECHO(["Please send $at_msg and all information you think might help:
 
    To: <AT_PACKAGE_BUGREPORT>
    Subject: @<:@AT_PACKAGE_STRING@:>@ $as_me: dnl
-$at_fail_list${at_fail_list:+ failed${at_xpass_list:+, }}dnl
-$at_xpass_list${at_xpass_list:+ passed unexpectedly}
+$at_msg1$at_msg2
 
 You may investigate any problem if you feel able to do so, in which
 case the test suite provides a good starting point.  Its output may