[libyaml-syck-perl] 01/02: Add patch from CPAN RT to fix wide unicode characters issues

gregor herrmann gregoa at debian.org
Fri Aug 9 15:35:58 UTC 2013


This is an automated email from the git hooks/post-receive script.

gregoa pushed a commit to branch master
in repository libyaml-syck-perl.

commit 09a299e4be3b2f5420250783fa00f61d32363ff9
Author: gregor herrmann <gregoa at debian.org>
Date:   Fri Aug 9 17:28:44 2013 +0200

    Add patch from CPAN RT to fix wide unicode characters issues
    
    on several architectures.
    
    Thanks: Hector Oron for the bug report.
    Closes: #718743
---
 ...001-Recognize-all-wide-unicode-characters.patch |  102 ++++++++++++++++++++
 debian/patches/series                              |    1 +
 2 files changed, 103 insertions(+)

diff --git a/debian/patches/0001-Recognize-all-wide-unicode-characters.patch b/debian/patches/0001-Recognize-all-wide-unicode-characters.patch
new file mode 100644
index 0000000..bf1e2bb
--- /dev/null
+++ b/debian/patches/0001-Recognize-all-wide-unicode-characters.patch
@@ -0,0 +1,102 @@
+Origin: CPAN RT
+Bug: https://rt.cpan.org/Ticket/Display.html?id=83825
+Bug-Debian: http://bugs.debian.org/718743
+Forwarded: not-needed
+Author: gregor herrmann <gregoa at debian.org>
+Reviewed-by: gregor herrmann <gregoa at debian.org>
+Last-Update: 2013-08-09
+
+From f646fa6ce15984b4a7d3c7b633be4129ad00c407 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at redhat.com>
+Date: Fri, 8 Mar 2013 13:00:52 +0100
+Subject: [PATCH] Recognize all wide unicode characters
+
+Type cast explicitly to (signed char) because sizof(char) can differ
+from sizof(int). Also do not quote bytes above 0x7F because we assume
+UTF-8 encoding.
+
+This should be fixed properly by UTF-8 to Unicode decoding but we
+need to recognize which encoding is in use before. How?
+---
+ emitter.c | 22 +++++++++++-----------
+ syck.h    |  2 +-
+ 2 files changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/emitter.c b/emitter.c
+index 48141b3..1d1a609 100644
+--- a/emitter.c
++++ b/emitter.c
+@@ -16,9 +16,9 @@
+ 
+ #define DEFAULT_ANCHOR_FORMAT "id%03d"
+ 
+-const char hex_table[] = 
++const unsigned char hex_table[] = 
+ "0123456789ABCDEF";
+-static char b64_table[] =
++static unsigned char b64_table[] =
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+ 
+ /*
+@@ -598,12 +598,12 @@ syck_scan_scalar( int req_width, char *cursor, long len )
+     /* scan string */
+     for ( i = 0; i < len; i++ ) {
+ 
+-        if ( ! ( (unsigned)cursor[i] == 0x9 ||
+-                 (unsigned)cursor[i] == 0xA ||
+-                 (unsigned)cursor[i] == 0xD ||
+-               ( (unsigned)cursor[i] >= 0x20 && (unsigned)cursor[i] <= 0x7E ) ||
+-                 (unsigned)cursor[i] == 0x85 ||
+-                 (unsigned)cursor[i] >= 0xa0 )
++        if ( ! ( (unsigned char)cursor[i] == 0x9 ||
++                 (unsigned char)cursor[i] == 0xA ||
++                 (unsigned char)cursor[i] == 0xD ||
++               ( (unsigned char)cursor[i] >= 0x20 &&
++                 (unsigned char)cursor[i] <= 0x7E ) ||
++                 (unsigned char)cursor[i] >= 0x80 )
+         ) {
+             flags |= SCAN_NONPRINT;
+         }
+@@ -812,7 +812,7 @@ void syck_emit_scalar( SyckEmitter *e, char *tag, enum scalar_style force_style,
+ }
+ 
+ void
+-syck_emitter_escape( SyckEmitter *e, char *src, long len )
++syck_emitter_escape( SyckEmitter *e, unsigned char *src, long len )
+ {
+     int i;
+     for( i = 0; i < len; i++ )
+@@ -927,7 +927,7 @@ void syck_emit_2quoted_1( SyckEmitter *e, int width, char *str, long len )
+             break;
+ 
+             default:
+-                syck_emitter_escape( e, mark, 1 );
++                syck_emitter_escape( e, (unsigned char *)mark, 1 );
+             break;
+         }
+         mark++;
+@@ -990,7 +990,7 @@ void syck_emit_2quoted( SyckEmitter *e, int width, char *str, long len )
+             break;
+ 
+             default:
+-                syck_emitter_escape( e, mark, 1 );
++                syck_emitter_escape( e, (unsigned char*)mark, 1 );
+             break;
+         }
+         mark++;
+diff --git a/syck.h b/syck.h
+index 2886561..f5118cd 100644
+--- a/syck.h
++++ b/syck.h
+@@ -411,7 +411,7 @@ void syck_emitter_handler( SyckEmitter *, SyckEmitterHandler );
+ void syck_free_emitter( SyckEmitter * );
+ void syck_emitter_clear( SyckEmitter * );
+ void syck_emitter_write( SyckEmitter *, const char *, long );
+-void syck_emitter_escape( SyckEmitter *, char *, long );
++void syck_emitter_escape( SyckEmitter *, unsigned char *, long );
+ void syck_emitter_flush( SyckEmitter *, long );
+ void syck_emit( SyckEmitter *, st_data_t );
+ void syck_emit_scalar( SyckEmitter *, char *, enum scalar_style, int, int, char, char *, long );
+-- 
+1.8.1.4
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..6be8fe1
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001-Recognize-all-wide-unicode-characters.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libyaml-syck-perl.git



More information about the Pkg-perl-cvs-commits mailing list