[svn:parrot] r47520 - branches/gsoc_nfg/src/string

darbelo at svn.parrot.org darbelo at svn.parrot.org
Wed Jun 9 22:28:45 UTC 2010


Author: darbelo
Date: Wed Jun  9 22:28:45 2010
New Revision: 47520
URL: https://trac.parrot.org/parrot/changeset/47520

Log:
Better handling of NULL grapheme tables in concatenation.

Modified:
   branches/gsoc_nfg/src/string/api.c

Modified: branches/gsoc_nfg/src/string/api.c
==============================================================================
--- branches/gsoc_nfg/src/string/api.c	Wed Jun  9 22:26:37 2010	(r47519)
+++ branches/gsoc_nfg/src/string/api.c	Wed Jun  9 22:28:45 2010	(r47520)
@@ -499,8 +499,14 @@
 
 #if PARROT_HAS_ICU
     if (enc == Parrot_nfg_encoding_ptr) {
-        dest->extra = a->extra;
-        merge_tables_and_fixup_string(interp, dest, b->extra, a->strlen);
+		if (a->extra != NULL) {
+            dest->extra = clone_grapheme_table(a->extra);
+            if (b->extra != NULL)
+                merge_tables_and_fixup_string(interp, dest, b->extra, a->strlen);
+		}
+		else {
+            dest->extra = clone_grapheme_table(b->extra);
+        }
     }
 #endif /* PARROT_HAS_ICU */
 


More information about the parrot-commits mailing list