Update of /cvsroot/monetdb/MonetDB5/src/modules/atoms
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv30322/src/modules/atoms

Modified Files:
      Tag: MonetDB_5-2
        str.mx 
Log Message:
strSubString shouldn't change the passed length argument. as this length
is reused in subsequenct calls


Index: str.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/modules/atoms/str.mx,v
retrieving revision 1.67.6.2
retrieving revision 1.67.6.3
diff -u -d -r1.67.6.2 -r1.67.6.3
--- str.mx      18 Dec 2007 08:38:15 -0000      1.67.6.2
+++ str.mx      18 Dec 2007 09:01:39 -0000      1.67.6.3
@@ -1648,24 +1648,24 @@
 int
 strSubString(str *res, str s, int *offset, int *length)
 {
-       int len, off = *offset;
+       int len, off = *offset, l = *length;
 
-       RETURN_NIL_IF(strNil(s) || off == int_nil || *length == int_nil, 
TYPE_str);
+       RETURN_NIL_IF(strNil(s) || off == int_nil || l == int_nil, TYPE_str);
        if (off < 0) {
                len = UTF8_strlen(s);
                RETURN_NIL_IF(len == int_nil, TYPE_str);
                off = len + off;
                if (off < 0) {
-                       *length += off;
+                       l += off;
                        off = 0;
                }
        }
-       if (*length < 0) {
+       if (l < 0) {
                *res = GDKstrdup("");
                return GDK_SUCCEED;
        }
        s = UTF8_strtail(s, MAX(0, off));
-       len = UTF8_strtail(s, *length) - s;
+       len = UTF8_strtail(s, l) - s;
        if (off < 0) {
                len += off;
                off = 0;


-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to