summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-05-31 07:04:06 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-05-31 08:17:42 -0700
commitd6ce2f2ab5dbf62e423f632aa9d727f55ac5911b (patch)
treedcdba78994e46ef0c02f7537806dba86545d7a71 /Makefile
parentf66b253353eeafd2c52f3e3834aefeb06012b284 (diff)
downloadtxr-d6ce2f2ab5dbf62e423f632aa9d727f55ac5911b.tar.gz
txr-d6ce2f2ab5dbf62e423f632aa9d727f55ac5911b.tar.bz2
txr-d6ce2f2ab5dbf62e423f632aa9d727f55ac5911b.zip
Eliminating the ! $ and - file-opening hacks.
Going forward, the "!command" and "$dir" are no longer recognized, except with the backward-compatibility -C option. The "-" string denoting standard input is only recognized from the command line, not in the @(next) directive; and "-" cannot be used in @(output) to denote standard output. The main problem is that these are hacks which intrude into the namespace. (What if a file is named "-", or begins with "!" or "$"?) Secondly, they are possible security holes. These prefixes are recognized even in computed strings, like "@(next var)" where var contains "!command". * Makefile (tst/tests/002/%): Run tests in this directory with the -C 142 option in TXR_OPTS, because they use the ! mechanism. * match.c (complex_open): New argument, from_cmdline, indicating whether the file name came from the command line or is internal. Function now only treats "-" as denoting standard input, if that came from the command line. The "!" and "$" prefixes are only recognized in compatibility with 142 or earlier. (v_next): Suppress old strategy of handling string sources by pushing them to the file list to let match_files open them. This is now done only under 142 compatibility. Instead, open directly, produce the list, and recurse into match_files with ready data. This is not only simpler, but also prevents "-" from being recognized in @(next), because complex_open is invoked directly, and the from_cmdline argument is specified as nil. (v_output): Don't rely on "-" denoting standard output; rather use the stream directly, which can be passed to complex_open. Pass nil to the new from_cmdline parameter of complex_open, so "-" isn't recognized. (open_data_source): Pass t for the from_cmdline parameter of complex_open, to have "-" recognized as denoting standard input. * txr.1: Removed documentation referring to !, and use of - in the @(next) and @(output) directives. Added notes to COMPATIBILITY section.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 84034cbb..0c443a1d 100644
--- a/Makefile
+++ b/Makefile
@@ -291,7 +291,7 @@ tst/tests/001/%: TXR_ARGS := tests/001/data
tst/tests/001/query-1.out: TXR_OPTS := -B
tst/tests/001/query-2.out: TXR_OPTS := -B
tst/tests/001/query-4.out: TXR_OPTS := -B
-tst/tests/002/%: TXR_OPTS := -DTESTDIR=tests/002
+tst/tests/002/%: TXR_OPTS := -C 142 -DTESTDIR=tests/002
tst/tests/004/%: TXR_ARGS := -a 123 -b -c
tst/tests/005/%: TXR_ARGS := tests/005/data
tst/tests/005/%: TXR_OPTS := -B