All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] input: Fix history line reading regression
@ 2024-04-27  9:11 Herbert Xu
  0 siblings, 0 replies; only message in thread
From: Herbert Xu @ 2024-04-27  9:11 UTC (permalink / raw)
  To: dash

When a newline is encountered with history support, terminate
the loop immediately.

Fixes: 44ae22beedf8 ("input: Disable lleft in SMALL mode")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
---
 src/input.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/input.c b/src/input.c
index 38969a7..fb9858f 100644
--- a/src/input.c
+++ b/src/input.c
@@ -301,7 +301,7 @@ again:
 		switch (c) {
 		case '\n':
 			parsefile->nleft = q - parsefile->nextc - 1;
-			goto check;
+			goto done;
 
 		default:
 			something = 1;
@@ -320,6 +320,7 @@ check:
 			break;
 		}
 	}
+done:
 	input_set_lleft(parsefile, more);
 
 	if (!IS_DEFINED_SMALL)
-- 
2.39.2

-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-04-27  9:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-27  9:11 [PATCH] input: Fix history line reading regression Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.