[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/2] Avoid portability problem with sourcing arbitrary name.
From: |
Eric Blake |
Subject: |
[PATCH 3/2] Avoid portability problem with sourcing arbitrary name. |
Date: |
Tue, 8 Jun 2010 07:00:58 -0600 |
* lib/autoconf/general.m4 (AC_SITE_LOAD): Avoid leading -.
* tests/base.at (AC_CACHE_CHECK): Enhance test.
Signed-off-by: Eric Blake <address@hidden>
---
I should probably squash this in, too.
ChangeLog | 4 ++++
lib/autoconf/general.m4 | 1 +
tests/base.at | 5 +++--
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d5fb294..aeddd3a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2010-06-08 Eric Blake <address@hidden>
+ Avoid portability problem with sourcing arbitrary name.
+ * lib/autoconf/general.m4 (AC_SITE_LOAD): Avoid leading -.
+ * tests/base.at (AC_CACHE_CHECK): Enhance test.
+
Avoid PATH search for CONFIG_SITE.
* lib/autoconf/general.m4 (AC_SITE_LOAD): Make more robust.
* tests/base.at (AC_CACHE_CHECK): Enhance test.
diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4
index 4ba9e68..3d7524d 100644
--- a/lib/autoconf/general.m4
+++ b/lib/autoconf/general.m4
@@ -1872,6 +1872,7 @@ ac_site_file2=NONE
if test -n "$CONFIG_SITE"; then
# We do not want a PATH search for config.site.
case $CONFIG_SITE in @%:@((
+ -*) ac_site_file1=./$CONFIG_SITE;;
*/*) ac_site_file1=$CONFIG_SITE;;
*) ac_site_file1=./$CONFIG_SITE;;
esac
diff --git a/tests/base.at b/tests/base.at
index 327ea68..96fafa4 100644
--- a/tests/base.at
+++ b/tests/base.at
@@ -395,13 +395,14 @@ AT_CHECK([grep cache stdout], [1])
AT_CHECK([LC_ALL=C ls -t config.cache a-stamp-file | sed 1q | grep
config.cache], [1])
# config.site can specify a site-wide cache, accumulating information.
-AT_DATA([config.site],
+# Also test that we don't run afoul of sourcing a file with leading -.
+AT_DATA([-config.site],
[[cache_file=sitecache
]])
AT_DATA([sitecache],
[[my_cv_some_preset_cache_var=yes
]])
-CONFIG_SITE=config.site
+CONFIG_SITE=-config.site
export CONFIG_SITE
AT_CHECK_CONFIGURE
AT_CHECK([grep my_cv_some_preset_cache_var sitecache], [], [ignore])
--
1.7.0.1