From 855762d6f4aff2733b77c2e41b29442d76812fc8 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sat, 18 Apr 2009 11:08:37 +0000 Subject: [PATCH] * dcrt0.cc (globify): Only call mbtowc for non-ascii chars. --- winsup/cygwin/ChangeLog | 4 ++++ winsup/cygwin/dcrt0.cc | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index d85bb0aa4..3c5d3e537 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2009-04-18 Corinna Vinschen + + * dcrt0.cc (globify): Only call mbtowc for non-ascii chars. + 2009-04-17 Corinna Vinschen * dcrt0.cc (globify): Make multibyte-aware. diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index eddd11479..90960afd0 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -229,7 +229,7 @@ globify (char *word, char **&argv, int &argc, int &argvlen) else if (s[1] == quote || s[1] == '\\') s++; *p++ = '\\'; - size_t cnt = mbtowc (NULL, s, MB_CUR_MAX); + size_t cnt = isascii (*s) ? 1 : mbtowc (NULL, s, MB_CUR_MAX); if (cnt <= 1 || cnt == (size_t)-1) *p++ = *s; else