svn commit: trunk/busybox/shell

vodz at busybox.net vodz at busybox.net
Mon Sep 5 15:46:28 UTC 2005


Author: vodz
Date: 2005-09-05 08:46:26 -0700 (Mon, 05 Sep 2005)
New Revision: 11334

Log:
destroy bug [0000404]

Modified:
   trunk/busybox/shell/cmdedit.c


Changeset:
Modified: trunk/busybox/shell/cmdedit.c
===================================================================
--- trunk/busybox/shell/cmdedit.c	2005-09-05 15:06:57 UTC (rev 11333)
+++ trunk/busybox/shell/cmdedit.c	2005-09-05 15:46:26 UTC (rev 11334)
@@ -310,7 +310,7 @@
 static void parse_prompt(const char *prmt_ptr)
 {
 	int prmt_len = 0;
-	int sub_len = 0;
+	size_t cur_prmt_len = 0;
 	char  flg_not_length = '[';
 	char *prmt_mem_ptr = xcalloc(1, 1);
 	char *pwd_buf = xgetcwd(0);
@@ -415,15 +415,15 @@
 		}
 		if(pbuf == buf)
 			*pbuf = c;
-		prmt_len += strlen(pbuf);
+		cur_prmt_len = strlen(pbuf);
+		prmt_len += cur_prmt_len;
+		if (flg_not_length != ']')
+			cmdedit_prmt_len += cur_prmt_len;
 		prmt_mem_ptr = strcat(xrealloc(prmt_mem_ptr, prmt_len+1), pbuf);
-		if (flg_not_length == ']')
-			sub_len++;
 	}
 	if(pwd_buf!=(char *)bb_msg_unknown)
 		free(pwd_buf);
 	cmdedit_prompt = prmt_mem_ptr;
-	cmdedit_prmt_len = prmt_len - sub_len;
 	put_prompt();
 }
 #endif




More information about the busybox-cvs mailing list