diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-05-31 07:04:06 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-05-31 08:17:42 -0700 |
commit | d6ce2f2ab5dbf62e423f632aa9d727f55ac5911b (patch) | |
tree | dcdba78994e46ef0c02f7537806dba86545d7a71 /struct.c | |
parent | f66b253353eeafd2c52f3e3834aefeb06012b284 (diff) | |
download | txr-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 'struct.c')
0 files changed, 0 insertions, 0 deletions