Subject: Re: bug#26779: expr length

From: Paul Eggert <[email-masked]>
Date: Thu, 18 May 2017 22:47:33 -0700

Assaf Gordon wrote:

> The downside of 'mbstowcs' is that it fails and does not continue
> when it encounters invalid multibyte sequences,

It's OK for expr to report an error and exit in that case, which should be simple.

It's not a big deal.

> I fixed the one case I spotted - if I missed any, please let me know
> ("make syntax-check" passes, but there could be others).

char* -> char *

MB_CUR_MAX==1 -> MB_CUR_MAX == 1

mbs_logical_cspn ('hello','a') -> mbs_logical_cspn ('hello', 'a') [in a comment]

const char *_string -> const char *string

* mbui_cur_ptr (iter) -> *mbui_cur_ptr (iter)

(s+1) -> s + 1

Put */ at end of last line of comment, not at start of next.

MB_CUR_MAX>1 -> MB_CUR_MAX > 1

xmalloc ( blen + 1 ) -> xmalloc (blen + 1)

idx<pos -> idx < pos

mempcpy ( vlim -> mempcpy (vlim

d>=ofs -> d >= ofs

size_t c=0; -> size_t c = 0;

No need to use "const" on locals, unless perhaps you take their address.

Probably more instances; got tired of looking....