Update of /cvsroot/monetdb/MonetDB4/src/modules/plain
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv30276/src/modules/plain
Modified Files:
Tag: MonetDB_4-20
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/MonetDB4/src/modules/plain/str.mx,v
retrieving revision 1.3.6.2
retrieving revision 1.3.6.3
diff -u -d -r1.3.6.2 -r1.3.6.3
--- str.mx 18 Dec 2007 08:37:49 -0000 1.3.6.2
+++ str.mx 18 Dec 2007 09:01:18 -0000 1.3.6.3
@@ -1585,24 +1585,24 @@
int
strSubString(str *res, str s, wrd *offset, wrd *length)
{
- wrd len, off = *offset;
+ wrd len, off = *offset, l = *length;
- RETURN_NIL_IF(strNil(s) || off == wrd_nil || *length == wrd_nil,
TYPE_str);
+ RETURN_NIL_IF(strNil(s) || off == wrd_nil || l == wrd_nil, TYPE_str);
if (off < 0) {
len = UTF8_strlen(s);
RETURN_NIL_IF(len == wrd_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