Skip to content

Commit

Permalink
Use MB_CUR_MAX == 6 by default
Browse files Browse the repository at this point in the history
Internally, Cygwin already uses __utf8_mbtowc(), even if it still claims
to use the "ASCII" charset.

But the `MB_CUR_MAX` value (which is not actually a constant, but
dependent on the current locale) was still 1, which broke the initial
`globify()` call while parsing the the command-line in `build_argv()`
for non-ASCII arguments.

This fixes git-for-windows/git#2189

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Sep 6, 2023
1 parent 0362055 commit 9ad0bae
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions newlib/libc/locale/lctype.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@

#define LCCTYPE_SIZE (sizeof(struct lc_ctype_T) / sizeof(char *))

#ifdef __CYGWIN__
/* Cygwin uses __utf8_mbtowc() by default, therefore mb_cur_max := 6 */
static char numone[] = { '\x06', '\0'};
#else
static char numone[] = { '\1', '\0'};
#endif

const struct lc_ctype_T _C_ctype_locale = {
"ASCII", /* codeset */
Expand Down

0 comments on commit 9ad0bae

Please sign in to comment.