comparison src/ex_getln.c @ 10970:ab9f7bbe4439 v8.0.0374

patch 8.0.0374: invalid memory access when using :sc in Ex mode commit https://github.com/vim/vim/commit/ba748c8a847561c043a63827bcb1d98bdebe16e6 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Feb 26 14:00:07 2017 +0100 patch 8.0.0374: invalid memory access when using :sc in Ex mode Problem: Invalid memory access when using :sc in Ex mode. (Dominique Pelle) Solution: Avoid the column being negative. Also fix a hang in Ex mode.
author Christian Brabandt <cb@256bit.org>
date Sun, 26 Feb 2017 14:15:04 +0100
parents e05695e59f6d
children 778c10516955
comparison
equal deleted inserted replaced
10969:beefabd60ec9 10970:ab9f7bbe4439
2367 char_u *s; 2367 char_u *s;
2368 2368
2369 if (ga_grow(&line_ga, 40) == FAIL) 2369 if (ga_grow(&line_ga, 40) == FAIL)
2370 break; 2370 break;
2371 2371
2372 /* Get one character at a time. */ 2372 /*
2373 * Get one character at a time.
2374 */
2373 prev_char = c1; 2375 prev_char = c1;
2374 c1 = vgetc(); 2376
2377 /* Check for a ":normal" command and no more characters left. */
2378 if (ex_normal_busy > 0 && typebuf.tb_len == 0)
2379 c1 = '\n';
2380 else
2381 c1 = vgetc();
2375 2382
2376 /* 2383 /*
2377 * Handle line editing. 2384 * Handle line editing.
2378 * Previously this was left to the system, putting the terminal in 2385 * Previously this was left to the system, putting the terminal in
2379 * cooked mode, but then CTRL-D and CTRL-T can't be used properly. 2386 * cooked mode, but then CTRL-D and CTRL-T can't be used properly.