mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] console_countdown: Add CR as valid return key
@ 2020-07-16 13:27 Jules Maselbas
  2020-08-10 19:46 ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Jules Maselbas @ 2020-07-16 13:27 UTC (permalink / raw)
  To: Barebox List; +Cc: Jules Maselbas

Now both LF ('\n') and CR ('\r') are valid keys to abort
console_countdown when using CONSOLE_COUNTDOWN_RETURN flag.

Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu>
---
 common/console_countdown.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/console_countdown.c b/common/console_countdown.c
index 74dc38279..b92948f50 100644
--- a/common/console_countdown.c
+++ b/common/console_countdown.c
@@ -64,7 +64,7 @@ int console_countdown(int timeout_s, unsigned flags, const char *keys,
 					goto out;
 				if (flags & CONSOLE_COUNTDOWN_ANYKEY)
 					goto out;
-				if (flags & CONSOLE_COUNTDOWN_RETURN && key == '\n')
+				if (flags & CONSOLE_COUNTDOWN_RETURN && (key == '\n' || key == '\r'))
 					goto out;
 				if (flags & CONSOLE_COUNTDOWN_CTRLC && key == 3)
 					goto out;
-- 
2.17.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-08-11 11:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-16 13:27 [PATCH] console_countdown: Add CR as valid return key Jules Maselbas
2020-08-10 19:46 ` Sascha Hauer
2020-08-11  9:29   ` Jules Maselbas
2020-08-11 11:24     ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox