bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: realloc: start and end chunk sizes differ - rl_extend_line_buffer in


From: Chet Ramey
Subject: Re: realloc: start and end chunk sizes differ - rl_extend_line_buffer in lib/readline/util.c
Date: Thu, 31 Jan 2019 13:33:42 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

On 1/7/19 5:10 AM, Eduardo A. Bustamante López wrote:

> diff -ruN bash-5.0-rc1.orig/lib/readline/search.c 
> bash-5.0-rc1/lib/readline/search.c
> --- bash-5.0-rc1.orig/lib/readline/search.c     2019-01-03 13:14:43.428392927 
> -0800
> +++ bash-5.0-rc1/lib/readline/search.c  2019-01-07 01:39:44.245179141 -0800
> @@ -255,6 +255,8 @@
>    rl_maybe_unsave_line ();
>    rl_clear_message ();
>    rl_point = cxt->save_point;
> +  if (rl_point > rl_end)
> +    rl_point = rl_end;
>    rl_mark = cxt->save_mark;
>    rl_restore_prompt ();

Thanks for the catch.

> I wonder if this should be a macro or if there is a better way to ensure that
> rl_point is never greater than rl_end.

This is why _rl_fix_point (int x) exists. Call it with a non-zero value for
x if you want it to validate and fix up rl_mark also.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]