[svn:parrot] r46319 - trunk/src/string

bacek at svn.parrot.org bacek at svn.parrot.org
Wed May 5 21:47:21 UTC 2010


Author: bacek
Date: Wed May  5 21:47:21 2010
New Revision: 46319
URL: https://trac.parrot.org/parrot/changeset/46319

Log:
Avoid creating of empty strings in str_concat if arguments are null.
NotFound++ for noticing.

Modified:
   trunk/src/string/api.c

Modified: trunk/src/string/api.c
==============================================================================
--- trunk/src/string/api.c	Wed May  5 21:47:08 2010	(r46318)
+++ trunk/src/string/api.c	Wed May  5 21:47:21 2010	(r46319)
@@ -404,7 +404,7 @@
     /* If B isn't real, we just bail */
     const UINTVAL b_len = b ? Parrot_str_byte_length(interp, b) : 0;
     if (!b_len)
-        return Parrot_str_copy(interp, a);
+        return STRING_IS_NULL(a) ? STRINGNULL : Parrot_str_copy(interp, a);
 
     /* Is A real? */
     if (STRING_IS_NULL(a) || Buffer_bufstart(a) == NULL)


More information about the parrot-commits mailing list