浏览代码

Fix control-c handing in CONFIG_CMDLINE_EDITING
Properly pass break code back from readline.
Patch by Roger Blofeld, 31 Jul 2006

Stefan Roese 18 年之前
父节点
当前提交
d8f961bbda
共有 2 个文件被更改,包括 7 次插入2 次删除
  1. 4 0
      CHANGELOG
  2. 3 2
      common/main.c

+ 4 - 0
CHANGELOG

@@ -2,6 +2,10 @@
 Changes since U-Boot 1.1.4:
 ======================================================================
 
+* Fix control-c handing in CONFIG_CMDLINE_EDITING
+  Properly pass break code back from readline.
+  Patch by Roger Blofeld, 31 Jul 2006
+
 * Add commandline history support to all AMCC eval boards
   Patch by Stefan Roese, 07 Aug 2006
 

+ 3 - 2
common/main.c

@@ -937,6 +937,7 @@ int readline (const char *const prompt)
 #ifdef CONFIG_CMDLINE_EDITING
 	char *p = console_buffer;
 	unsigned int len=MAX_CMDBUF_SIZE;
+	int rc;
 	static int initted = 0;
 
 	if (!initted) {
@@ -946,8 +947,8 @@ int readline (const char *const prompt)
 
 	puts (prompt);
 
-	cread_line(p, &len);
-	return len;
+	rc = cread_line(p, &len);
+	return rc < 0 ? rc : len;
 #else
 	char   *p = console_buffer;
 	int	n = 0;				/* buffer index		*/