Contents of /trunk/openmotif/patches/openmotif-2.2.3-char_not_supported.patch
Parent Directory | Revision Log
Revision 153 -
(show annotations)
(download)
Tue May 8 20:52:56 2007 UTC (17 years, 4 months ago) by niro
File size: 1014 byte(s)
Tue May 8 20:52:56 2007 UTC (17 years, 4 months ago) by niro
File size: 1014 byte(s)
-import
1 | --- openMotif-2.2.3/lib/Xm/TextF.c.char_not_supported 2004-06-03 12:59:10.241822710 +0200 |
2 | +++ openMotif-2.2.3/lib/Xm/TextF.c 2004-06-03 13:02:18.987890852 +0200 |
3 | @@ -3723,20 +3723,17 @@ |
4 | cache_ptr = tmp = XmStackAlloc(buf_size, cache); |
5 | |
6 | tmp_str = (wchar_t *)str; |
7 | - ret_val = wctomb(tmp, *tmp_str); |
8 | + // Fixed MZ BZ#1257: by Brad Despres <brad@sd.aonix.com> |
9 | count = 0; |
10 | - while ( (ret_val > 0)&& (buf_size >= MB_CUR_MAX) && (count < n) ) |
11 | - { |
12 | - count += 1; |
13 | - tmp += ret_val; |
14 | - buf_size -= ret_val; |
15 | - tmp_str++; |
16 | - ret_val = wctomb(tmp, *tmp_str); |
17 | - } |
18 | - |
19 | + do { |
20 | + ret_val = wctomb(tmp, *tmp_str); |
21 | + count += 1; |
22 | + tmp += ret_val; |
23 | + buf_size -= ret_val; |
24 | + tmp_str++; |
25 | + } while ( (ret_val > 0)&& (buf_size >= MB_CUR_MAX) && (count < n) ) ; |
26 | if (ret_val == -1) /* bad character */ |
27 | return (False); |
28 | - |
29 | is_printable = XTextWidth(TextF_Font(tf), cache_ptr, tmp - cache_ptr); |
30 | XmStackFree(cache_ptr, cache); |
31 | return (is_printable); |