-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy path050-CR7065478.patch
46 lines (43 loc) · 976 Bytes
/
050-CR7065478.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
--- a/src/lib/libast/comp/setlocale.c Mon Dec 27 04:23:49 2010
+++ b/src/lib/libast/comp/setlocale.c Fri Jul 22 00:30:31 2011
@@ -19,6 +19,9 @@
* Phong Vo <[email protected]> *
* *
***********************************************************************/
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
#pragma prototyped
/*
@@ -2236,6 +2239,24 @@
typedef int (*Isw_f)(wchar_t);
+static int
+wide_wctomb(char* u, wchar_t w)
+{
+ int size = 0;
+
+ if (u)
+ {
+ size = wctomb(u, w);
+ if (size < 0)
+ {
+ *u = (char)(w & 0xff);
+ size = 1;
+ }
+ }
+
+ return size;
+}
+
/*
* called when LC_CTYPE initialized or changes
*/
@@ -2280,7 +2301,7 @@
{
if (!(ast.mb_width = wcwidth))
ast.mb_width = default_wcwidth;
- ast.mb_conv = wctomb;
+ ast.mb_conv = wide_wctomb;
#ifdef mb_state
{
/*