summaryrefslogtreecommitdiff
path: root/cfg.mk
diff options
context:
space:
mode:
authorGary V. Vaughan <gary@gnu.org>2011-11-21 18:02:23 +0700
committerGary V. Vaughan <gary@gnu.org>2011-11-25 14:53:42 +0700
commit61e09a55669820ab0cd2bb3ffcdbd8e40baa6497 (patch)
treedf3973f64940db29edce1062bc4106a2c8e834e7 /cfg.mk
parent962aa919f51cdf8e2cee4fb2d1d9bafa34d50887 (diff)
downloadlibtool-61e09a55669820ab0cd2bb3ffcdbd8e40baa6497.tar.gz
syntax-check: fix violations and implement sc_prohibit_sed_s_comma.
I like to name temporary directories that I will remove shortly with two leading commas so that they sort lexicographically at the top of `ls' output. Now, `./configure --prefix=`pwd`/,,inst' works again, for the first time in several years. * cfg.mk (sc_prohibit_sed_s_comma): Comma is too common a character to use routinely as the separator for sed substitutions on file paths and other variables determined by the user, causing bugs like the one I describe above. Make sure we don't accidentally reintroduce any comma separators in future. * Makefile.am, bootstrap, bootstrap.conf, build-aux/extract-trace, build-aux/general.m4sh, build-aux/git-hooks/commit-msg, build-aux/git-log-fix, build-aux/ltmain.m4sh, libtoolize.m4sh, m4/libtool.m4, m4/ltdl.m4, tests/cdemo-undef.test, tests/cmdline_wrap.at, tests/darwin.at, tests/defs.m4sh, tests/getopt-m4sh.at, tests/install.at, tests/libtoolize.at, tests/mdemo/Makefile.am, tests/need_lib_prefix.at, tests/sysroot.at, tests/tagdemo-undef.test, tests/testsuite.at: Try to use `|' as the default separator wherever possible, otherwise something else that doesn't occur in the substitution expression. * NEWS: Updated. Signed-off-by: Gary V. Vaughan <gary@gnu.org>
Diffstat (limited to 'cfg.mk')
-rw-r--r--cfg.mk10
1 files changed, 10 insertions, 0 deletions
diff --git a/cfg.mk b/cfg.mk
index 918870ec..dc89660c 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -100,6 +100,16 @@ sc_prohibit_nested_quotes:
halt='found nested double quotes' \
$(_sc_search_regexp_or_exclude)
+# Commas in filenames are quite common, so using them routinely for sed is
+# asking for trouble!
+sc_prohibit_sed_s_comma:
+ @explicit='($$SED|sed)[ ]+(-e[ ]+)?['\''"]?s,' \
+ implicit='['\''";][ ]*s,[^,]*,[^,]*,g?['\''";]' \
+ literal='^[ ]*s,[^,]*,[^,]*,g?['\''";]?$$' \
+ prohibit='('$$implicit'|'$$explicit'|'$$literal')' \
+ halt='found use of comma separator in sed substitution' \
+ $(_sc_search_regexp)
+
# Check for using shift after set dummy (same or following line).
exclude_file_name_regexp--sc_prohibit_set_dummy_without_shift = ^cfg.mk$$
sc_prohibit_set_dummy_without_shift: