On Monday 28 September 2009 10:39, Mikhail Gusarov wrote:
> Hi.
> 
> Ctrl-D on empty line no longer exits ash.
> 
> bisected to
> 
> commit 2e6d4ef695c4be0ff1963e24315bc5bec6c5313b
> Author: Denys Vlasenko <[email protected]>
> Date:   Fri Jul 10 18:40:49 2009 +0200
> 
>     lineedit: implement Unicode-aware line editing (optional)

Thanks for narrowing it down! Please try this patch.
--
vda
diff -d -urpN busybox.4/libbb/lineedit.c busybox.5/libbb/lineedit.c
--- busybox.4/libbb/lineedit.c	2009-09-27 02:44:48.000000000 +0200
+++ busybox.5/libbb/lineedit.c	2009-09-28 23:54:50.000000000 +0200
@@ -114,8 +114,8 @@ struct lineedit_statics {
 	unsigned cmdedit_prmt_len; /* length of prompt (without colors etc) */
 
 	unsigned cursor;
-	unsigned command_len;
-	/* *int* maxsize: we want x in "if (x > S.maxsize)"
+	int command_len; /* must be signed */
+	/* signed maxsize: we want x in "if (x > S.maxsize)"
 	 * to _not_ be promoted to unsigned */
 	int maxsize;
 	CHAR_T *command_ps;
@@ -2124,7 +2124,9 @@ int FAST_FUNC read_line_input(const char
 #undef command
 
 #if ENABLE_FEATURE_ASSUME_UNICODE
-	command_len = save_string(command, maxsize - 1);
+	command[0] = '\0';
+	if (command_len > 0)
+		command_len = save_string(command, maxsize - 1);
 	free(command_ps);
 #endif
 
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to