From 6bef719302d6db33c63fb6f2636986dff1941ac2 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 18 Feb 2021 21:37:08 +0000 Subject: users/26509: fix for r -L fc with the -L option should ignore remote entires, rather than reading them and treating them as an error. --- Src/builtin.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Src/builtin.c') diff --git a/Src/builtin.c b/Src/builtin.c index 3093a3056..26335a2e8 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -1599,8 +1599,9 @@ bin_fc(char *nam, char **argv, Options ops, int func) * command line to avoid giving the user a nasty turn * if some helpful soul ran "print -s 'rm -rf /'". */ - first = OPT_ISSET(ops,'l')? addhistnum(curhist,-16,0) - : addhistnum(curline.histnum,-1,0); + int xflags = OPT_ISSET(ops,'L') ? HIST_FOREIGN : 0; + first = OPT_ISSET(ops,'l')? addhistnum(curhist,-16,xflags) + : addhistnum(curline.histnum,-1,xflags); if (first < 1) first = 1; if (last < first) -- cgit 1.4.1