[BusyBox-cvs] busybox/shell cmdedit.c,1.88,1.89

Glenn McGrath bug1 at busybox.net
Sun Feb 22 11:13:30 UTC 2004


Update of /var/cvs/busybox/shell
In directory nail:/tmp/cvs-serv2182/shell

Modified Files:
	cmdedit.c 
Log Message:
Vodz. last_patch_128
- declare applet_using as static from applets.c
- small correction to cmdedit,
   previous version cleared history after Ctrl-C
- small spelling correction (by Friedrich Lobenstock)


Index: cmdedit.c
===================================================================
RCS file: /var/cvs/busybox/shell/cmdedit.c,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -d -r1.88 -r1.89
--- a/cmdedit.c	4 Feb 2004 08:24:39 -0000	1.88
+++ b/cmdedit.c	22 Feb 2004 11:13:28 -0000	1.89
@@ -1290,7 +1290,7 @@
 			put_prompt();
 #else
 			len = 0;
-			break_out = -1; /* for control traps */
+			break_out = -1; /* to control traps */
 #endif
 			break;
 		case 4:
@@ -1304,7 +1304,8 @@
 				/* cmdedit_reset_term() called in atexit */
 				exit(EXIT_SUCCESS);
 #else
-				len = break_out = -1; /* for control stoped jobs */
+				/* to control stopped jobs */
+				len = break_out = -1;
 				break;
 #endif
 			} else {
@@ -1430,12 +1431,12 @@
 				break;
 			case '1':
 			case 'H':
-				/* Home (Ctrl-A) */
+				/* <Home> */
 				input_backward(cursor);
 				break;
 			case '4':
 			case 'F':
-				/* End (Ctrl-E) */
+				/* <End> */
 				input_end();
 				break;
 			default:
@@ -1496,10 +1497,11 @@
 #if MAX_HISTORY >= 1
 	/* Handle command history log */
 	/* cleanup may be saved current command line */
-	free(history[MAX_HISTORY]);
-	history[MAX_HISTORY] = 0;
 	if (len> 0) {                                      /* no put empty line */
 		int i = n_history;
+
+		free(history[MAX_HISTORY]);
+		history[MAX_HISTORY] = 0;
 			/* After max history, remove the oldest command */
 		if (i >= MAX_HISTORY) {
 			free(history[0]);




More information about the busybox-cvs mailing list