Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 382010 Details for
Bug 518740
app-text/hunspell-1.3.3 bump
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
hunspell multibyte character patch
hunspell-1.3.3-multibyte-chars.patch (text/plain), 1.81 KB, created by
Jan Seeger
on 2014-08-01 12:48:22 UTC
(
hide
)
Description:
hunspell multibyte character patch
Filename:
MIME Type:
Creator:
Jan Seeger
Created:
2014-08-01 12:48:22 UTC
Size:
1.81 KB
patch
obsolete
>--- src/tools/hunspell.cxx~0 2011-01-21 19:01:29.000000000 +0200 >+++ src/tools/hunspell.cxx 2013-02-07 10:11:54.443610900 +0200 >@@ -710,13 +748,22 @@ if (pos >= 0) { > fflush(stdout); > } else { > char ** wlst = NULL; >- int ns = pMS[d]->suggest(&wlst, token); >+ int byte_offset = parser->get_tokenpos() + pos; >+ int char_offset = 0; >+ if (strcmp(io_enc, "UTF-8") == 0) { >+ for (int i = 0; i < byte_offset; i++) { >+ if ((buf[i] & 0xc0) != 0x80) >+ char_offset++; >+ } >+ } else { >+ char_offset = byte_offset; >+ } >+ int ns = pMS[d]->suggest(&wlst, chenc(token, io_enc, dic_enc[d])); > if (ns == 0) { >- fprintf(stdout,"# %s %d", token, >- parser->get_tokenpos() + pos); >+ fprintf(stdout,"# %s %d", token, char_offset); > } else { > fprintf(stdout,"& %s %d %d: ", token, ns, >- parser->get_tokenpos() + pos); >+ char_offset); > fprintf(stdout,"%s", chenc(wlst[0], dic_enc[d], io_enc)); > } > for (int j = 1; j < ns; j++) { >@@ -745,13 +792,23 @@ if (pos >= 0) { > if (root) free(root); > } else { > char ** wlst = NULL; >+ int byte_offset = parser->get_tokenpos() + pos; >+ int char_offset = 0; >+ if (strcmp(io_enc, "UTF-8") == 0) { >+ for (int i = 0; i < byte_offset; i++) { >+ if ((buf[i] & 0xc0) != 0x80) >+ char_offset++; >+ } >+ } else { >+ char_offset = byte_offset; >+ } > int ns = pMS[d]->suggest(&wlst, chenc(token, io_enc, dic_enc[d])); > if (ns == 0) { > fprintf(stdout,"# %s %d", chenc(token, io_enc, ui_enc), >- parser->get_tokenpos() + pos); >+ char_offset); > } else { > fprintf(stdout,"& %s %d %d: ", chenc(token, io_enc, ui_enc), ns, >- parser->get_tokenpos() + pos); >+ char_offset); > fprintf(stdout,"%s", chenc(wlst[0], dic_enc[d], ui_enc)); > } > for (int j = 1; j < ns; j++) { >
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 518740
:
382008
| 382010