Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 146442 Details for
Bug 208511
"info" cannot deal with CJK characters
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Clean up of the above patch: use the mbswidth module from gnulib
makeinfo-mbswidth.patch (text/plain), 7.02 KB, created by
Miloslav Trmač
on 2007-01-24 19:41:39 UTC
(
hide
)
Description:
Clean up of the above patch: use the mbswidth module from gnulib
Filename:
MIME Type:
Creator:
Miloslav Trmač
Created:
2007-01-24 19:41:39 UTC
Size:
7.02 KB
patch
obsolete
>Index: configure.ac >=================================================================== >RCS file: /sources/texinfo/texinfo/configure.ac,v >retrieving revision 1.67 >diff -u -r1.67 configure.ac >--- foo/configure.ac 27 Dec 2006 16:20:17 -0000 1.67 >+++ foo/configure.ac 24 Jan 2007 19:27:41 -0000 >@@ -81,8 +81,8 @@ > # in theory only pre-sysvr3 systems needed this and it's not likely > # that anyone compiling new texinfo still has such a thing? we'll see. > # AC_FUNC_SETVBUF_REVERSED >-AC_CHECK_FUNCS(bzero getcwd memset setvbuf sigaction sigprocmask \ >- sigsetmask strchr wcwidth) >+AC_CHECK_FUNCS(bzero getcwd memset setlocale setvbuf sigaction sigprocmask \ >+ sigsetmask strchr) > AC_REPLACE_FUNCS(memcpy memmove strdup strerror) > > # We want to recognize djgpp to avoid the useless warning about no >Index: makeinfo/cmds.c >=================================================================== >RCS file: /sources/texinfo/texinfo/makeinfo/cmds.c,v >retrieving revision 1.68 >diff -u -r1.68 cmds.c >--- foo/makeinfo/cmds.c 7 Jan 2007 22:59:08 -0000 1.68 >+++ foo/makeinfo/cmds.c 24 Jan 2007 19:27:41 -0000 >@@ -19,6 +19,7 @@ > Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ > > #include "system.h" >+#include "mbswidth.h" > #include "cmds.h" > #include "defun.h" > #include "files.h" >@@ -1545,7 +1546,7 @@ > > output_paragraph_offset = ++i; > length = output_paragraph_offset - start; >- width = string_width ((char *)(output_paragraph + start), length); >+ width = mbsnwidth ((char *)(output_paragraph + start), length, 0); > > if (width < (fill_column - fudge_factor)) > { >Index: makeinfo/index.c >=================================================================== >RCS file: /sources/texinfo/texinfo/makeinfo/index.c,v >retrieving revision 1.21 >diff -u -r1.21 index.c >--- foo/makeinfo/index.c 11 Dec 2006 14:59:59 -0000 1.21 >+++ foo/makeinfo/index.c 24 Jan 2007 19:27:41 -0000 >@@ -19,6 +19,7 @@ > Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ > > #include "system.h" >+#include "mbswidth.h" > #include "files.h" > #include "footnote.h" > #include "html.h" >@@ -673,11 +674,11 @@ > int i = output_paragraph_offset; > while (0 < i && output_paragraph[i-1] != '\n') > i--; >- last_column = string_width ((char *)(output_paragraph + i), >- output_paragraph_offset - i); >+ last_column = mbsnwidth ((char *)(output_paragraph + i), >+ output_paragraph_offset - i, 0); > } > >- out_line_no_width = string_width (out_line_no_str, strlen (out_line_no_str)); >+ out_line_no_width = mbswidth (out_line_no_str, 0); > if (last_column + out_line_no_width > fill_column) > { > insert ('\n'); >@@ -895,7 +896,7 @@ > { > int width; > >- width = string_width (index->entry, strlen (index->entry)); >+ width = mbswidth (index->entry, 0); > sprintf (line, "* %*s ", width < MIN_ENTRY_COLUMNS > ? -(strlen (index->entry) > + (MIN_ENTRY_COLUMNS - width)) >Index: makeinfo/makeinfo.c >=================================================================== >RCS file: /sources/texinfo/texinfo/makeinfo/makeinfo.c,v >retrieving revision 1.89 >diff -u -r1.89 makeinfo.c >--- foo/makeinfo/makeinfo.c 11 Dec 2006 14:59:59 -0000 1.89 >+++ foo/makeinfo/makeinfo.c 24 Jan 2007 19:27:42 -0000 >@@ -22,6 +22,7 @@ > > #include "system.h" > #include "getopt.h" >+#include "mbswidth.h" > > #define COMPILING_MAKEINFO > #include "makeinfo.h" >@@ -39,10 +40,6 @@ > #include "toc.h" > #include "xml.h" > >-#ifdef HAVE_WCWIDTH >-# include <wchar.h> >-#endif >- > /* You can change some of the behavior of Makeinfo by changing the > following defines: */ > >@@ -2463,45 +2460,6 @@ > } > } > >-/* Return the number of columns necessary for displaying STRING of LEN >- bytes. */ >-int >-string_width (const char *string, size_t length) >-{ >-#ifdef HAVE_WCWIDTH >- int width; >- >- mbtowc (NULL, NULL, 0); >- width = 0; >- while (length > 0) >- { >- wchar_t wc; >- int l, w; >- >- l = mbtowc (&wc, string, length); >- if (l == -1) >- { >- mbtowc (NULL, NULL, 0); >- w = 1; >- l = 1; >- } >- else >- { >- if (l == 0) >- l = 1; >- w = wcwidth (wc); >- if (w == -1) >- w = 1; >- } >- width += w; >- string += l; >- length -= l; >- } >- return width; >-#endif >- return length; >-} >- > /* Return the 0-based number of the current output column */ > int > current_output_column (void) >@@ -2530,7 +2488,7 @@ > } > if (i < j) > { >- column += string_width ((char *)(output_paragraph + i), j - i); >+ column += mbsnwidth ((char *)(output_paragraph + i), j - i, 0); > i = j; > } > if (i < output_paragraph_offset) >@@ -2808,15 +2766,6 @@ > output_paragraph_offset++; > column = current_output_column (); > output_paragraph_offset--; >- /* The string_width () in current_output_column () cannot predict >- future incoming bytes. So if output_paragraph ends in a partial >- multibyte character, its bytes are counted as separate column >- positions. This may push column past fill_column, even though the >- finished multibyte character would fit on the current line. >- >- This is too hard to fix without modifying add_char () to recieve >- complete multibyte characters at a time, and causes only slightly >- incorrect paragraph filling, so we punt. */ > if (column > fill_column) > { > if (filling_enabled && !html) >@@ -3211,7 +3160,8 @@ > { > int width; > >- width = string_width((char *)output_paragraph, output_paragraph_offset); >+ width = mbsnwidth ((char *)output_paragraph, output_paragraph_offset - 1, >+ 0) + 1; > if (width < fill_column) > { > int i; >Index: makeinfo/makeinfo.h >=================================================================== >RCS file: /sources/texinfo/texinfo/makeinfo/makeinfo.h,v >retrieving revision 1.22 >diff -u -r1.22 makeinfo.h >--- foo/makeinfo/makeinfo.h 11 Dec 2006 14:59:59 -0000 1.22 >+++ foo/makeinfo/makeinfo.h 24 Jan 2007 19:27:42 -0000 >@@ -369,7 +369,6 @@ > search_forward (char *string, int from), > search_forward_until_pos (char *string, int from, int end_pos), > next_nonwhitespace_character (void), >- string_width (const char *string, size_t length), > current_output_column (void), > fs_error (char *filename); > >Index: makeinfo/multi.c >=================================================================== >RCS file: /sources/texinfo/texinfo/makeinfo/multi.c,v >retrieving revision 1.13 >diff -u -r1.13 multi.c >--- foo/makeinfo/multi.c 11 Dec 2006 14:59:59 -0000 1.13 >+++ foo/makeinfo/multi.c 24 Jan 2007 19:27:42 -0000 >@@ -21,6 +21,7 @@ > Originally written by phr@gnu.org (Paul Rubin). */ > > #include "system.h" >+#include "mbswidth.h" > #include "cmds.h" > #include "insertion.h" > #include "makeinfo.h" >@@ -468,7 +469,7 @@ > /* Do not output trailing blanks if we're in the last column and > there will be no trailing |. */ > if (i < last_column && !vsep) >- for (s = string_width ((char *)&CHAR_AT (0), j); >+ for (s = mbsnwidth ((char *)&CHAR_AT (0), j, 0); > s <= envs[i].fill_column; s++) > out_char (' '); > if (vsep)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 208511
:
141191
|
142775
|
142865
| 146442 |
148073
|
148074