summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author宇砂ワシ <usawashi16@yahoo.co.jp>2019-04-27 22:46:34 +0900
committerAndrej Shadura <andrewsh@debian.org>2019-07-18 15:15:27 -0300
commite4fb75b267adda0b37bf9bdc093a125914e0e25d (patch)
tree9c23a0ded0d6ea5cbc00004862f55d8092d16a5e
parentb31e8f22d25d20e421af99722f66688cabf1708e (diff)
histedit: Fix infinite loop when using 'fc -s'
When compiling with libedit, he.num may somehow overrun last, causing an infinite loop when using fc -s. This mild change to the check plugs it. Bug-Debian: https://bugs.debian.org/928072 Gbp-Pq: Name 0017-histedit-Fix-infinite-loop-when-using-fc--s.patch
-rw-r--r--src/histedit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/histedit.c b/src/histedit.c
index f5c90ab..aaac1c2 100644
--- a/src/histedit.c
+++ b/src/histedit.c
@@ -388,7 +388,7 @@ histcmd(int argc, char **argv)
* At end? (if we were to lose last, we'd sure be
* messed up).
*/
- if (he.num == last)
+ if (he.num >= last)
break;
}
if (editor) {