From: Eric Blake Date: Mon, 27 Oct 2008 16:36:59 +0000 (-0600) Subject: Use read, rather than `cat`, for safe one-line files. X-Git-Tag: v2.63b~187 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf99ea9775cc8f2b18710f117de9291f6a7e8166;p=thirdparty%2Fautoconf.git 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. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index eab5a93e8..313124b97 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-10-27 Eric Blake + + 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 * lib/autoconf/general.m4 (_AC_COMPUTE_INT_COMPILE, diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index 8b8424512..000f705b7 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -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 "$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