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);
}
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
vi_mode = viflag;
}
-void
+static void
vi_Word_motion(char *command, int eat)
{
while (cursor < len && !isspace(command[cursor]))
input_forward();
}
-void
+static void
vi_word_motion(char *command, int eat)
{
if (isalnum(command[cursor]) || command[cursor] == '_') {
input_forward();
}
-void
+static void
vi_End_motion(char *command)
{
input_forward();
input_forward();
}
-void
+static void
vi_end_motion(char *command)
{
if (cursor >= len-1)
}
}
-void
+static void
vi_Back_motion(char *command)
{
while (cursor > 0 && isspace(command[cursor-1]))
input_backward(1);
}
-void
+static void
vi_back_motion(char *command)
{
if (cursor <= 0)