about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorMartijn Dekker <martijn@inlv.org>2021-02-16 18:34:41 +0000
committerPeter Stephenson <p.stephenson@samsung.com>2021-02-17 10:21:08 +0000
commit9c0533931c51b7d512d3e95850404f5aac2dbce1 (patch)
treea26b4c6da996989ce6c4e010b65aa41deedb8f98 /Src
parent326d9c203b3980c0f841bc62b06e37134c6e51ea (diff)
downloadzsh-9c0533931c51b7d512d3e95850404f5aac2dbce1.tar.gz
zsh-9c0533931c51b7d512d3e95850404f5aac2dbce1.tar.xz
zsh-9c0533931c51b7d512d3e95850404f5aac2dbce1.zip
48073: Add fc -s as POSIX way of rerunning command without starting editor
Diffstat (limited to 'Src')
-rw-r--r--Src/builtin.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Src/builtin.c b/Src/builtin.c
index 35a0fb2db..3093a3056 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -71,7 +71,7 @@ static struct builtin builtins[] =
      * But that's actually not useful, so it's more consistent to
      * cause an error.
      */
-    BUILTIN("fc", 0, bin_fc, 0, -1, BIN_FC, "aAdDe:EfiIlLmnpPrRt:W", NULL),
+    BUILTIN("fc", 0, bin_fc, 0, -1, BIN_FC, "aAdDe:EfiIlLmnpPrRst:W", NULL),
     BUILTIN("fg", 0, bin_fg, 0, -1, BIN_FG, NULL, NULL),
     BUILTIN("float", BINF_PLUSOPTS | BINF_MAGICEQUALS | BINF_PSPECIAL | BINF_ASSIGN, (HandlerFunc)bin_typeset, 0, -1, 0, "E:%F:%HL:%R:%Z:%ghlp:%rtux", "E"),
     BUILTIN("functions", BINF_PLUSOPTS, bin_functions, 0, -1, 0, "ckmMstTuUWx:z", NULL),
@@ -1643,7 +1643,7 @@ bin_fc(char *nam, char **argv, Options ops, int func)
 	    if (!fclist(out, ops, first, last, asgf, pprog, 1)) {
 		char *editor;
 
-		if (func == BIN_R)
+		if (func == BIN_R || OPT_ISSET(ops, 's'))
 		    editor = "-";
 		else if (OPT_HASARG(ops, 'e'))
 		    editor = OPT_ARG(ops, 'e');