public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/5] Check for NULL prompt in readline_into_buffer()
@ 2009-10-23  0:59 Peter Tyser
  2009-10-23  0:59 ` [U-Boot] [PATCH 2/5] cread_line(): Remove unused variables Peter Tyser
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Peter Tyser @ 2009-10-23  0:59 UTC (permalink / raw)
  To: u-boot

Previously, passing readline() or readline_into_buffer() a NULL 'prompt'
parameter would result in puts() printing garbage when
CONFIG_CMDLINE_EDITING was enabled.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
---
 common/main.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/common/main.c b/common/main.c
index 026edd1..298982a 100644
--- a/common/main.c
+++ b/common/main.c
@@ -964,7 +964,8 @@ int readline_into_buffer (const char *const prompt, char * buffer)
 			initted = 1;
 		}
 
-		puts (prompt);
+		if (prompt)
+			puts (prompt);
 
 		rc = cread_line(prompt, p, &len);
 		return rc < 0 ? rc : len;
-- 
1.6.2.1

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

end of thread, other threads:[~2009-10-25  5:32 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-23  0:59 [U-Boot] [PATCH 1/5] Check for NULL prompt in readline_into_buffer() Peter Tyser
2009-10-23  0:59 ` [U-Boot] [PATCH 2/5] cread_line(): Remove unused variables Peter Tyser
2009-10-23  0:59 ` [U-Boot] [PATCH 3/5] readline(): Add ability to modify a string buffer Peter Tyser
2009-10-24 17:26   ` Wolfgang Denk
2009-10-24 21:47     ` Peter Tyser
2009-10-25  5:32       ` Mike Frysinger
2009-10-23  0:59 ` [U-Boot] [PATCH 4/5] _do_setenv(): Delete 0-length environment variables Peter Tyser
2009-10-23  0:59 ` [U-Boot] [PATCH 5/5] Add 'editenv' command Peter Tyser
2009-10-24 17:23 ` [U-Boot] [PATCH 1/5] Check for NULL prompt in readline_into_buffer() Wolfgang Denk
2009-10-24 21:37   ` Peter Tyser
2009-10-24 21:47     ` Wolfgang Denk
2009-10-24 21:52       ` Peter Tyser
2009-10-24 22:00         ` Wolfgang Denk

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