diff options
author | Mathieu Arnold <mat@FreeBSD.org> | 2016-06-20 16:23:28 +0000 |
---|---|---|
committer | Mathieu Arnold <mat@FreeBSD.org> | 2016-06-20 16:23:28 +0000 |
commit | 7ae7b018ccf7760013f368fcb83aad9ecd8982a8 (patch) | |
tree | e83ee6693050a76e305a95a376451aa583df151e /multimedia/w_scan/files/patch-char-coding.c | |
parent | textproc/rubygem-gitlab-grit: make it work with rubygem-mime-types again (diff) |
With the power of USES=dos2unix, get rid of most patches and files
with CRLF.
While there, run make makepatch, rename patches to use the new scheme,
and various fixes.
With hat: portmgr
Sponsored by: Absolight
Diffstat (limited to 'multimedia/w_scan/files/patch-char-coding.c')
-rw-r--r-- | multimedia/w_scan/files/patch-char-coding.c | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/multimedia/w_scan/files/patch-char-coding.c b/multimedia/w_scan/files/patch-char-coding.c index 2169ee592671..fb87b8a35811 100644 --- a/multimedia/w_scan/files/patch-char-coding.c +++ b/multimedia/w_scan/files/patch-char-coding.c @@ -1,35 +1,35 @@ ---- a/char-coding.c -+++ b/char-coding.c +--- char-coding.c.orig 2016-06-20 13:13:56 UTC ++++ char-coding.c @@ -250,6 +250,10 @@ void char_coding(char **inbuf, size_t * - // Fallback method: copy all printable chars from *inbuf to *outbuf.
- size_t i;
- size_t pos = 0;
-+#ifdef __FreeBSD__
-+ int to_utf = user_charset_id < iconv_codes_count() &&
-+ !strncmp(iconv_codes[user_charset_id], "UTF", sizeof "UTF" - 1);
-+#endif
-
- for (i = 0; i < nsrc; i++) {
- switch((uint8_t) *(psrc + i)) {
-@@ -257,7 +259,21 @@ void char_coding(char **inbuf, size_t * - //case 0xA0 ... 0xFF:
- // printable chars ISO-6937-2
- // Figure A.1: Character code table 00 - Latin alphabet
-+#ifdef __FreeBSD__
-+ case 0x80 ... 0xFF:
-+ // the iconv used on FreeBSD doesn't know about the
-+ // default DVB charset ISO_6937-2 so we'll end up here
-+ // for 8-bit chars in channel names that are (usually
-+ // wrongly) specified as the default charset - and if
-+ // we are converting to utf those will create invalid
-+ // encodings.
-+ if (to_utf)
-+ continue;
-+ // FALLTHRU
-+ case 0x01 ... 0x7F:
-+#else
- case 0x01 ... 0xFF: // 20121202: don't touch anything; leave it as it is.
-+#endif
- *(pdest + pos++) = *(psrc + i);
- default:;
- }
+ // Fallback method: copy all printable chars from *inbuf to *outbuf. + size_t i; + size_t pos = 0; ++#ifdef __FreeBSD__ ++ int to_utf = user_charset_id < iconv_codes_count() && ++ !strncmp(iconv_codes[user_charset_id], "UTF", sizeof "UTF" - 1); ++#endif + + for (i = 0; i < nsrc; i++) { + switch((uint8_t) *(psrc + i)) { +@@ -257,7 +261,21 @@ void char_coding(char **inbuf, size_t * + //case 0xA0 ... 0xFF: + // printable chars ISO-6937-2 + // Figure A.1: Character code table 00 - Latin alphabet ++#ifdef __FreeBSD__ ++ case 0x80 ... 0xFF: ++ // the iconv used on FreeBSD doesn't know about the ++ // default DVB charset ISO_6937-2 so we'll end up here ++ // for 8-bit chars in channel names that are (usually ++ // wrongly) specified as the default charset - and if ++ // we are converting to utf those will create invalid ++ // encodings. ++ if (to_utf) ++ continue; ++ // FALLTHRU ++ case 0x01 ... 0x7F: ++#else + case 0x01 ... 0xFF: // 20121202: don't touch anything; leave it as it is. ++#endif + *(pdest + pos++) = *(psrc + i); + default:; + } |