summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
author"Vladimir N. Oleynik" <dzo@simtreas.ru>2005-09-05 15:46:26 +0000
committer"Vladimir N. Oleynik" <dzo@simtreas.ru>2005-09-05 15:46:26 +0000
commitf087480da192dcae6977bd373ca617abd2b3b200 (patch)
treeaaf0d009f1f7c08f4ad736915f9e193d52bcd1ca /shell
parenta8c23aa7959716bf33b41a890791eb7c3c4d3e74 (diff)
downloadbusybox-w32-f087480da192dcae6977bd373ca617abd2b3b200.tar.gz
busybox-w32-f087480da192dcae6977bd373ca617abd2b3b200.tar.bz2
busybox-w32-f087480da192dcae6977bd373ca617abd2b3b200.zip
destroy bug [0000404]
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