[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: srfi-13 bug2
From: |
Jan Nieuwenhuizen |
Subject: |
Re: srfi-13 bug2 |
Date: |
Mon, 13 Sep 2004 21:30:46 +0200 |
User-agent: |
Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) |
Jan Nieuwenhuizen writes:
> Found it. It turns out that
>
> guile -c '(string-contains "" "a")'
>
> hangs with guile CVS. See fix below.
Too quick. Same for string-contains-ci, of course.
Jan.
? do-diff
? doconf
Index: libguile/ChangeLog
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/libguile/ChangeLog,v
retrieving revision 1.2146
diff -p -u -r1.2146 ChangeLog
--- libguile/ChangeLog 8 Sep 2004 23:04:08 -0000 1.2146
+++ libguile/ChangeLog 13 Sep 2004 19:29:14 -0000
@@ -1,3 +1,9 @@
+2004-09-13 Jan Nieuwenhuizen <address@hidden>
+
+ * 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 <address@hidden>
* filesys.c, stime.c (_POSIX_C_SOURCE): Use this only on hpux, it
Index: libguile/srfi-13.c
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/libguile/srfi-13.c,v
retrieving revision 1.4
diff -p -u -r1.4 srfi-13.c
--- libguile/srfi-13.c 7 Sep 2004 13:48:49 -0000 1.4
+++ libguile/srfi-13.c 13 Sep 2004 19:29:15 -0000
@@ -2253,7 +2253,7 @@ SCM_DEFINE (scm_string_contains, "string
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, "str
5, start2, cstart2,
6, end2, cend2);
len2 = cend2 - cstart2;
- while (cstart1 <= cend1 - len2)
+ while (cstart1 <= cend1 - len2 && cend1 >= len2)
{
i = cstart1;
j = cstart2;
--
Jan Nieuwenhuizen <address@hidden> | GNU LilyPond - The music typesetter
http://www.xs4all.nl/~jantien | http://www.lilypond.org