* lisp/eshell/em-hist.el
(eshell-previous-matching-input-string-position): Both before and
within the while loop, n is always smaller than n (bug#43056).
Copyright-paperwork-exempt: yes
(setq prev n
n (mod (+ n motion) len))
;; If we haven't reached a match, step some more.
- (while (and (< n len) (not tried-each-ring-item)
+ (while (and (not tried-each-ring-item)
(not (string-match regexp (eshell-get-history n))))
(setq n (mod (+ n motion) len)
;; If we have gone all the way around in this search.