diff Objects/stringlib/count.h @ 38516:2fe3233bd426 legacy-trunk

changed count to return 0 for slices outside the source string
author Fredrik Lundh <fredrik@pythonware.com>
date Tue, 30 May 2006 17:39:58 +0000
parents d5bdfd120232
children 304bea8731d2
line wrap: on
line diff
--- a/Objects/stringlib/count.h	Tue May 30 17:37:54 2006 +0000
+++ b/Objects/stringlib/count.h	Tue May 30 17:39:58 2006 +0000
@@ -15,7 +15,7 @@
 
     if (sub_len == 0) {
         if (str_len < 0)
-            return 1; /* start >= len(str) */
+            return 0; /* start > len(str) */
         return str_len + 1;
     }