Changeset: c830918c53d0 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c830918c53d0
Modified Files:
        monetdb5/modules/atoms/url.mx
Branch: Dec2011
Log Message:

Simplify and correct url_getContext.


diffs (27 lines):

diff --git a/monetdb5/modules/atoms/url.mx b/monetdb5/modules/atoms/url.mx
--- a/monetdb5/modules/atoms/url.mx
+++ b/monetdb5/modules/atoms/url.mx
@@ -302,7 +302,8 @@ url_getContent(str *retval, /* put strin
 static str
 url_getContext(str *retval, url Str1)
 {
-       str s, d;
+       const char *s;
+       str d;
 
        if (Str1 == 0)
                throw(ILLARG, "url.getContext", "url missing");
@@ -315,11 +316,10 @@ url_getContext(str *retval, url Str1)
 
        s = strchr(s, '/');
        if (s == 0)
-               s= (str) str_nil;
-       d = GDKmalloc(strlen(Str1) - (s - Str1) + 1);
+               s = str_nil;
+       d = GDKstrdup(s);
        if (d == NULL)
                throw(MAL, "url.getContext", "Allocation failed");
-       strcpy(d, s);
        *retval = d;
        return MAL_SUCCEED;
 }
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to