aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorvodz <vodz@69ca8d6d-28ef-0310-b511-8ec308f3f277>2005-09-05 15:46:26 +0000
committervodz <vodz@69ca8d6d-28ef-0310-b511-8ec308f3f277>2005-09-05 15:46:26 +0000
commit2042b88432c8eb37199a465b689246b2a77ae2c1 (patch)
treeaaf0d009f1f7c08f4ad736915f9e193d52bcd1ca /shell
parentb40ea07ce6722687baac27ff10606b24a6af6145 (diff)
downloadbusybox-w32-2042b88432c8eb37199a465b689246b2a77ae2c1.tar.gz
busybox-w32-2042b88432c8eb37199a465b689246b2a77ae2c1.tar.bz2
busybox-w32-2042b88432c8eb37199a465b689246b2a77ae2c1.zip
destroy bug [0000404]
git-svn-id: svn://busybox.net/trunk/busybox@11334 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'shell')
-rw-r--r--shell/cmdedit.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/shell/cmdedit.c b/shell/cmdedit.c
index c67283f4a..6e3ae07f9 100644
--- a/shell/cmdedit.c
+++ b/shell/cmdedit.c
@@ -310,7 +310,7 @@ static void parse_prompt(const char *prmt_ptr)
310static void parse_prompt(const char *prmt_ptr) 310static void parse_prompt(const char *prmt_ptr)
311{ 311{
312 int prmt_len = 0; 312 int prmt_len = 0;
313 int sub_len = 0; 313 size_t cur_prmt_len = 0;
314 char flg_not_length = '['; 314 char flg_not_length = '[';
315 char *prmt_mem_ptr = xcalloc(1, 1); 315 char *prmt_mem_ptr = xcalloc(1, 1);
316 char *pwd_buf = xgetcwd(0); 316 char *pwd_buf = xgetcwd(0);
@@ -415,15 +415,15 @@ static void parse_prompt(const char *prmt_ptr)
415 } 415 }
416 if(pbuf == buf) 416 if(pbuf == buf)
417 *pbuf = c; 417 *pbuf = c;
418 prmt_len += strlen(pbuf); 418 cur_prmt_len = strlen(pbuf);
419 prmt_len += cur_prmt_len;
420 if (flg_not_length != ']')
421 cmdedit_prmt_len += cur_prmt_len;
419 prmt_mem_ptr = strcat(xrealloc(prmt_mem_ptr, prmt_len+1), pbuf); 422 prmt_mem_ptr = strcat(xrealloc(prmt_mem_ptr, prmt_len+1), pbuf);
420 if (flg_not_length == ']')
421 sub_len++;
422 } 423 }
423 if(pwd_buf!=(char *)bb_msg_unknown) 424 if(pwd_buf!=(char *)bb_msg_unknown)
424 free(pwd_buf); 425 free(pwd_buf);
425 cmdedit_prompt = prmt_mem_ptr; 426 cmdedit_prompt = prmt_mem_ptr;
426 cmdedit_prmt_len = prmt_len - sub_len;
427 put_prompt(); 427 put_prompt();
428} 428}
429#endif 429#endif