summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorнаб <nabijaczleweli@nabijaczleweli.xyz>2023-02-07 20:33:38 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2024-04-06 16:53:03 +0800
commit9b9f39396a3b468237d6f361b36e9394ce6b3b84 (patch)
tree21c9cb06e6e5d602436b58f4701338054f34f8f0
parent459e51a2ae9d720b12e44fa725a6014a4d784d7c (diff)
downloaddash-9b9f39396a3b468237d6f361b36e9394ce6b3b84.tar.gz
histedit: Don't require argument for fc
This is already handled correctly (per POSIX) below: When the synopsis form with -s is used: If first is omitted, the previous command shall be used. For the synopsis forms without -s: If first and last are both omitted, the previous 16 commands shall be listed or the previous single command shall be edited (based on the -l option). Test log: $ ls autogen.sh ChangeLog ... $ id uid=1000(nabijaczleweli) gid=100(users) groups=100(users) $ who nabijaczleweli pts/2 2023-02-07 18:36 (192.168.1.109) $ fc 4 , who q nabijaczleweli pts/2 2023-02-07 18:36 (192.168.1.109) $ fc -l 1 ls 2 id 3 who 4 fc $ fc -s fc -l 1 ls 2 id 3 who 4 fc 5 fc -l Reported-by: Harald van Dijk <harald@gigawatt.nl> Reported-in: https://marc.info/?l=dash&m=154707728009743&w=2 Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--src/histedit.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/src/histedit.c b/src/histedit.c
index 07dd1b4..7692776 100644
--- a/src/histedit.c
+++ b/src/histedit.c
@@ -212,9 +212,6 @@ histcmd(int argc, char **argv)
if (hist == NULL)
sh_error("history not active");
- if (argc == 1)
- sh_error("missing history argument");
-
#ifdef __GLIBC__
optind = 0;
#else