expr: use mcel
commit17bddc047b5003c1b02cf98f9f3484a681cfa627
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 21 Sep 2023 23:59:48 +0000 (21 16:59 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 23 Sep 2023 07:28:26 +0000 (23 00:28 -0700)
tree8ecc09f34bf6c1c17878debf941991d2c9947e3e
parent654700ba5d2a58efc474e00baf2bd4e57bf09095
expr: use mcel

The mcel API is simpler and corresponds more closely to how
Emacs etc. behave when the input has encoding errors,
since it treats each encoding-error byte separately.
* bootstrap.conf (gnulib_modules): Add mcel.
* src/expr.c: Include mcel.h instead of mbuiter.h.
(mbs_logical_cspn, mbs_logical_substr, mbs_offset_to_chars):
Use mcel API.
(mbs_logical_substr): Use ximemdup0 so as not to waste memory in
the result, fixing a FIXME.
bootstrap.conf
src/expr.c