aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2009-04-17 14:51:44 +0000
committerCorinna Vinschen <corinna@vinschen.de>2009-04-17 14:51:44 +0000
commit0351fbd504d344a47b6f160a6034f1ffb27f1b62 (patch)
tree4107ecd40ff17002e8f5c8f06921cc9474552d2c /winsup
parenta74869c027033e90b0cc8e15ef96ac0a82ab06eb (diff)
downloadnewlib-0351fbd504d344a47b6f160a6034f1ffb27f1b62.zip
newlib-0351fbd504d344a47b6f160a6034f1ffb27f1b62.tar.gz
newlib-0351fbd504d344a47b6f160a6034f1ffb27f1b62.tar.bz2
* dcrt0.cc (globify): Make multibyte-aware.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog4
-rw-r--r--winsup/cygwin/dcrt0.cc10
2 files changed, 13 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index b81dba3..d85bb0a 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,9 @@
2009-04-17 Corinna Vinschen <corinna@vinschen.de>
+ * dcrt0.cc (globify): Make multibyte-aware.
+
+2009-04-17 Corinna Vinschen <corinna@vinschen.de>
+
* flock.cc (class inode_t): Add i_wait member and matching methods
wait(), unwait(), and waiting().
(inode_t::inode_t): Initialize i_wait to 0.
diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
index 70d2650..eddd114 100644
--- a/winsup/cygwin/dcrt0.cc
+++ b/winsup/cygwin/dcrt0.cc
@@ -229,7 +229,15 @@ globify (char *word, char **&argv, int &argc, int &argvlen)
else if (s[1] == quote || s[1] == '\\')
s++;
*p++ = '\\';
- *p++ = *s;
+ size_t cnt = mbtowc (NULL, s, MB_CUR_MAX);
+ if (cnt <= 1 || cnt == (size_t)-1)
+ *p++ = *s;
+ else
+ {
+ --s;
+ while (cnt-- > 0)
+ *p++ = *++s;
+ }
}
if (*s == quote)
p--;