diff options
author | Paolo Bonzini <bonzini@gnu.org> | 2004-11-15 08:32:38 +0000 |
---|---|---|
committer | Paolo Bonzini <bonzini@gnu.org> | 2008-01-09 16:10:53 +0100 |
commit | 7f53c1c16e7654427dc884e528f5e2d201c15fc5 (patch) | |
tree | 6b93c7428c98ab288a85522223bf2c851ce128c0 /sed/sed.h | |
parent | fd8f5daad7b858955182827b44205a862376667b (diff) | |
download | sed-7f53c1c16e7654427dc884e528f5e2d201c15fc5.tar.gz |
fix \l and \u in a multi-byte configuration
2004-11-15 Paolo Bonzini <bonzini@gnu.org>
* sed/execute.c (str_append_modified): Copy the first character
when using \l or \u in a multi-byte configuration. Use
WCRTOMB instead of wcrtomb.
* sed/sed.h (WCRTOMB): New.
git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-19
Diffstat (limited to 'sed/sed.h')
-rw-r--r-- | sed/sed.h | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -233,9 +233,17 @@ extern int mb_cur_max; (mb_cur_max == 1 ? \ (*(pwc) = btowc (*(unsigned char *) (s)), 1) : \ mbrtowc ((pwc), (s), (n), (ps))) + +#define WCRTOMB(s, wc, ps) \ + (mb_cur_max == 1 ? \ + (*(s) = wctob ((wint_t) (wc)), 1) : \ + wcrtomb ((s), (wc), (ps))) #else #define MBRTOWC(pwc, s, n, ps) \ mbrtowc ((pwc), (s), (n), (ps)) + +#define WCRTOMB(s, wc, ps) \ + wcrtomb ((s), (wc), (ps)) #endif #define MBRLEN(s, n, ps) \ |