diff options
author | "Vladimir N. Oleynik" <dzo@simtreas.ru> | 2005-09-05 19:46:26 +0400 |
---|---|---|
committer | "Vladimir N. Oleynik" <dzo@simtreas.ru> | 2005-09-05 19:46:26 +0400 |
commit | f087480da192dcae6977bd373ca617abd2b3b200 (patch) | |
tree | aaf0d009f1f7c08f4ad736915f9e193d52bcd1ca /shell | |
parent | a8c23aa7959716bf33b41a890791eb7c3c4d3e74 (diff) |
destroy bug [0000404]
Diffstat (limited to 'shell')
-rw-r--r-- | shell/cmdedit.c | 10 |
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) 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 @@ static void parse_prompt(const char *prmt_ptr) } 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 |