summaryrefslogtreecommitdiffstats
path: root/txr.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-05-30 23:04:31 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-05-30 23:04:31 -0700
commitc91af9a17b0533c6df846ff712e7ade306c7b38a (patch)
treedb34c427af795aff50f1a2227b88cfa6698af196 /txr.c
parent8cd3b90ca5b3b3cf8d2796da6b9374784c0f10cf (diff)
downloadtxr-c91af9a17b0533c6df846ff712e7ade306c7b38a.tar.gz
txr-c91af9a17b0533c6df846ff712e7ade306c7b38a.tar.bz2
txr-c91af9a17b0533c6df846ff712e7ade306c7b38a.zip
command line: --eargs semantics change.
The --eargs mechanism won't perform a blind substring replacement of {} with the following argument. Only arguments which match {} exactly are replaced. * eval.c (retf): Static function becomes extern. * eval.h (retf): Declared. * txr.c (txr_main): Replace the filtering logic on the split eargs argument list to just look for items equal to the string "{}" and replace with the following argument. * txr.1: Updated --eargs documentation.
Diffstat (limited to 'txr.c')
-rw-r--r--txr.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/txr.c b/txr.c
index 3fdb18c0..ca80c2ca 100644
--- a/txr.c
+++ b/txr.c
@@ -573,9 +573,8 @@ int txr_main(int argc, char **argv)
}
arg = sub_str(arg, num(8), nil);
arg2 = upop(&arg_list, &arg_undo);
- arg_list = append2(mapcar(curry_123_3(func_n3(regsub),
- regex_compile(lit("{}"), nil),
- arg2),
+ arg_list = append2(mapcar(iffi(curry_12_2(equal_f, lit("{}")),
+ retf(arg2), nil),
split_str(arg, sep)),
arg_list);
set(eff_arg_tail, butlastn(one, deref(eff_arg_tail)));