This commit is contained in:
tg 2008-09-30 19:28:12 +00:00
parent 13231b50eb
commit 051522c9ea
2 changed files with 7 additions and 9 deletions

6
edit.c
View File

@ -5,7 +5,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.134 2008/09/30 19:25:49 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.135 2008/09/30 19:28:12 tg Exp $");
/* tty driver characters we are interested in */
typedef struct {
@ -4359,9 +4359,9 @@ vi_cmd(int argcnt, const char *cmd)
break;
case 'v':
if (es->linelen == 0 && argcnt == 0)
return -1;
if (!argcnt) {
if (es->linelen == 0)
return -1;
if (modified) {
es->cbuf[es->linelen] = '\0';
histsave(&source->line, es->cbuf, true,

8
lex.c
View File

@ -2,7 +2,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.70 2008/09/30 19:25:51 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.71 2008/09/30 19:28:12 tg Exp $");
/*
* states while lexing word
@ -1239,12 +1239,10 @@ getsc_line(Source *s)
if (s->type == SFILE)
shf_fdclose(s->u.shf);
s->str = NULL;
} else if (interactive) {
char *p = Xstring(s->xs, xp);
if (*p && (cur_prompt != PS1 || !ctype(*p, C_IFS | C_IFSWS))) {
} else if (interactive && *s->str &&
(cur_prompt != PS1 || !ctype(*s->str, C_IFS | C_IFSWS))) {
histsave(&s->line, s->str, true, true);
}
}
if (interactive)
set_prompt(PS2, NULL);
}