Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: pws-22: history -r fix



On Wed, 16 Jun 1999, Bart Schaefer wrote:
> On a possibly-related note, "history -r" seems to be broken now

Yes, the start-of-loop check was wrong.  Here's a patch:

Index: Src/builtin.c
--- zsh-3.1.5-pws-22/Src/builtin.c	Mon Jun 14 09:14:30 1999
+++ ./Src/builtin.c	Wed Jun 16 13:37:17 1999
@@ -1349,7 +1349,7 @@
 	fclistdone = 1;
 
     ent = gethistent(first, first < last? GETHIST_DOWNWARD : GETHIST_UPWARD);
-    if (!ent || ent->histnum < first || ent->histnum > last) {
+    if (!ent || (first < last? ent->histnum > last : ent->histnum < last)) {
 	if (first == last)
 	    zwarnnam("fc", "no such event: %d", NULL, first);
 	else

..wayne..





Messages sorted by: Reverse Date, Date, Thread, Author