Skip to content

Commit ce00dbc

Browse files
committed
updated for version 7.3.168
Problem: When the second argument of input() contains a CR the text up to that is used without asking the user. (Yasuhiro Matsumoto) Solution: Change CR, NL and ESC in the text to a space.
1 parent 9d8a66a commit ce00dbc

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/getchar.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,11 +635,14 @@ stuffReadbuffLen(s, len)
635635
/*
636636
* Stuff "s" into the stuff buffer, leaving special key codes unmodified and
637637
* escaping other K_SPECIAL and CSI bytes.
638+
* Change CR, LF and ESC into a space.
638639
*/
639640
void
640641
stuffReadbuffSpec(s)
641642
char_u *s;
642643
{
644+
int c;
645+
643646
while (*s != NUL)
644647
{
645648
if (*s == K_SPECIAL && s[1] != NUL && s[2] != NUL)
@@ -649,11 +652,16 @@ stuffReadbuffSpec(s)
649652
s += 3;
650653
}
651654
else
655+
{
652656
#ifdef FEAT_MBYTE
653-
stuffcharReadbuff(mb_ptr2char_adv(&s));
657+
c = mb_ptr2char_adv(&s);
654658
#else
655-
stuffcharReadbuff(*s++);
659+
c = *s++;
656660
#endif
661+
if (c == CAR || c == NL || c == ESC)
662+
c = ' ';
663+
stuffcharReadbuff(c);
664+
}
657665
}
658666
}
659667
#endif

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,8 @@ static char *(features[]) =
714714

715715
static int included_patches[] =
716716
{ /* Add new patch number below this line */
717+
/**/
718+
168,
717719
/**/
718720
167,
719721
/**/

0 commit comments

Comments
 (0)