Revision
3718
Author
lsansonetti@apple.com
Date
2010-03-09 16:43:25 -0800 (Tue, 09 Mar 2010)

Log Message

fixed a bug in string search

Modified Paths

Diff

Modified: MacRuby/branches/icu/string.c (3717 => 3718)


--- MacRuby/branches/icu/string.c	2010-03-09 23:04:10 UTC (rev 3717)
+++ MacRuby/branches/icu/string.c	2010-03-10 00:43:25 UTC (rev 3718)
@@ -1055,6 +1055,10 @@
     str_must_have_compatible_encoding(self, searched);
     str_make_same_format(self, searched);
 
+    if (searched->length_in_bytes == 0 && self->length_in_bytes == 0) {
+	return start_index;
+    }
+
     long start_offset_in_bytes;
     if (start_index == 0) {
 	start_offset_in_bytes = 0;