2004-09-13 Jan Nieuwenhuizen <janneke@gnu.org>
authorHan-Wen Nienhuys <hanwen@lilypond.org>
Tue, 14 Sep 2004 21:10:56 +0000 (21:10 +0000)
committerHan-Wen Nienhuys <hanwen@lilypond.org>
Tue, 14 Sep 2004 21:10:56 +0000 (21:10 +0000)
* srfi-13.c (scm_string_contains, s_scm_string_contains_ci):
Bugfix: when subtracting unsigned values, make sure that result
does not wrap.

libguile/ChangeLog
libguile/gc-segment.c
libguile/srfi-13.c

index 0106512..1b6e6ff 100644 (file)
@@ -1,3 +1,9 @@
+2004-09-13  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * srfi-13.c (scm_string_contains, s_scm_string_contains_ci):
+       Bugfix: when subtracting unsigned values, make sure that result
+       does not wrap.
+
 2004-09-09  Kevin Ryde  <user42@zip.com.au>
 
        * filesys.c, stime.c (_POSIX_C_SOURCE): Use this only on hpux, it
index 332624d..6a39de4 100644 (file)
@@ -128,7 +128,7 @@ scm_i_clear_segment_mark_space (scm_t_heap_segment *seg)
 }
 
 /*
-  Sweep cards from SEG until we've gather THRESHOLD cells
+  Sweep cards from SEG until we've gathered THRESHOLD cells
   
   RETURN:
 
index eb495af..eed0fa7 100644 (file)
@@ -2253,7 +2253,7 @@ SCM_DEFINE (scm_string_contains, "string-contains", 2, 4, 0,
                                   5, start2, cstart2,
                                   6, end2, cend2);
   len2 = cend2 - cstart2;
-  while (cstart1 <= cend1 - len2)
+  while (cstart1 <= cend1 - len2 && cend1 >= len2)
     {
       i = cstart1;
       j = cstart2;
@@ -2299,7 +2299,7 @@ SCM_DEFINE (scm_string_contains_ci, "string-contains-ci", 2, 4, 0,
                                   5, start2, cstart2,
                                   6, end2, cend2);
   len2 = cend2 - cstart2;
-  while (cstart1 <= cend1 - len2)
+  while (cstart1 <= cend1 - len2 && cend1 >= len2)
     {
       i = cstart1;
       j = cstart2;