optimise
This commit is contained in:
parent
13231b50eb
commit
051522c9ea
6
edit.c
6
edit.c
|
@ -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,
|
||||
|
|
10
lex.c
10
lex.c
|
@ -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,11 +1239,9 @@ 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))) {
|
||||
histsave(&s->line, s->str, true, true);
|
||||
}
|
||||
} 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);
|
||||
|
|
Loading…
Reference in New Issue