]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Use read, rather than `cat`, for safe one-line files.
authorEric Blake <ebb9@byu.net>
Mon, 27 Oct 2008 16:36:59 +0000 (10:36 -0600)
committerEric Blake <ebb9@byu.net>
Mon, 27 Oct 2008 22:04:12 +0000 (16:04 -0600)
* lib/autotest/general.m4 (AT_CLEANUP): Avoid a fork, since it is
known that the file has only one line and no \.
* lib/autoconf/general.m4 (_AC_COMPUTE_INT_RUN): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
lib/autoconf/general.m4
lib/autotest/general.m4

index eab5a93e87bd91aa74c8f583540a01db9b4cd44e..313124b970069abcb8b644b53cc277fc74daa482 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-10-27  Eric Blake  <ebb9@byu.net>
+
+       Use read, rather than `cat`, for safe one-line files.
+       * lib/autotest/general.m4 (AT_CLEANUP): Avoid a fork, since it is
+       known that the file has only one line and no \.
+       * lib/autoconf/general.m4 (_AC_COMPUTE_INT_RUN): Likewise.
+
 2008-10-27  Paolo Bonzini  <bonzini@gnu.org>
     
        * lib/autoconf/general.m4 (_AC_COMPUTE_INT_COMPILE,
index 8b8424512db5888ad0eade39ff623ebdcae164b1..000f705b76f59104f7558e7d00fd42a8b582b724 100644 (file)
@@ -2908,9 +2908,12 @@ esac[]dnl
 #                     [IF-FAILURE])
 # -----------------------------------------------------------------
 # Store the evaluation of the integer EXPRESSION in VARIABLE.
+#
+# AC_LANG_INT_SAVE intentionally does not end the file in a newline, so
+# we must add one to make it a text file before passing it to read.
 m4_define([_AC_COMPUTE_INT_RUN],
 [_AC_RUN_IFELSE([AC_LANG_INT_SAVE([$3], [$1])],
-              [AS_VAR_SET([$2], [`cat conftest.val`]); $4], [$5])
+               [echo >>conftest.val; read $2 <conftest.val; $4], [$5])
 rm -f conftest.val
 ])# _AC_COMPUTE_INT_RUN
 
@@ -2925,7 +2928,7 @@ m4_define([_AC_COMPUTE_INT_BODY],
                            [ac_retval=0], [ac_retval=1])
   else
     _AC_COMPUTE_INT_RUN([$[]2], [$[]3], [$[]4],
-                       [ac_retval=0], [ac_retval=1])
+                       [ac_retval=0], [ac_retval=1])
   fi
   AS_LINENO_POP
   return $ac_retval
index 149fff14926d713a2ada4a90186aac91d76d5e91..00817b1a75bf7a73bfe1894ae4780ff60b7f9fd5 100644 (file)
@@ -1674,7 +1674,7 @@ m4_undivert([TEST_SCRIPT])dnl Insert the code here
   $at_traceoff
   $at_times_p && times >"$at_times_file"
 ) AS_MESSAGE_LOG_FD>&1 2>&1 | eval $at_tee_pipe
-at_status=`cat "$at_status_file"`
+read at_status <"$at_status_file"
 [#AT_STOP_]AT_ordinal
 m4_divert_pop([TEST_GROUPS])dnl Back to KILL.
 ])# AT_CLEANUP