[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/3] grep: reset state after truncated or invalid multibyte s
From: |
Jim Meyering |
Subject: |
Re: [PATCH 2/3] grep: reset state after truncated or invalid multibyte sequences |
Date: |
Thu, 25 Mar 2010 09:40:08 +0100 |
Paolo Bonzini wrote:
> From: Norihirio Tanaka <address@hidden>
> * src/searchutils.c (is_mb_middle): When treating an invalid sequence
> or a truncated multibyte character as a single byte character, reset
> mbstate
> ---
> src/searchutils.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/src/searchutils.c b/src/searchutils.c
> index ef4fef3..960e3ba 100644
> --- a/src/searchutils.c
> +++ b/src/searchutils.c
> @@ -131,6 +131,7 @@ is_mb_middle(const char **good, const char *buf, const
> char *end)
> /* An invalid sequence, or a truncated multibyte character.
> We treat it as a single byte character. */
> mbclen = 1;
> + memset(mbstate, 0, sizeof(mbstate_t));
Thanks, but this does not even compile, since there
is no mbstate variable in that function.
I presume the intent is to clear the sole variable
in that function of type mbstate_t:
+ memset(&cur_state, 0, sizeof cur_state);