Changeset: 3513e759d5b2 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/3513e759d5b2
Modified Files:
        monetdb5/modules/atoms/url.c
Branch: urlfuncs
Log Message:

fix


diffs (34 lines):

diff --git a/monetdb5/modules/atoms/url.c b/monetdb5/modules/atoms/url.c
--- a/monetdb5/modules/atoms/url.c
+++ b/monetdb5/modules/atoms/url.c
@@ -948,17 +948,21 @@ BATextractURLHost(bat *res, const bat *b
                                        l = s - host;
                                }
                                if (domain && l > 3) {
-                                       if (no_www && !strncmp(host, "www.", 4))
+                                       if (no_www && !strncmp(host, "www.", 
4)) {
                                                host += 4;
-                                       // if ((msg = str_Sub_String(&buf, 
&buflen, host, 0, l)) != MAL_SUCCEED)
-                                       //      break;
-                                       if ((msg = str_buf_copy(&buf, &buflen, 
host, (size_t) l)) != MAL_SUCCEED)
-                                               break;
-                                       if (bunfastapp_nocheckVAR(bn, buf) != 
GDK_SUCCEED) {
-                                               msg = createException(MAL, 
"baturl.extractURLHost", SQLSTATE(HY013) MAL_MALLOC_FAIL );
-                                               break;
+                                               l -= 4;
                                        }
-                                       continue;
+                                       if (l > 0) {
+                                               // if ((msg = 
str_Sub_String(&buf, &buflen, host, 0, l)) != MAL_SUCCEED)
+                                               //      break;
+                                               if ((msg = str_buf_copy(&buf, 
&buflen, host, (size_t) l)) != MAL_SUCCEED)
+                                                       break;
+                                               if (bunfastapp_nocheckVAR(bn, 
buf) != GDK_SUCCEED) {
+                                                       msg = 
createException(MAL, "baturl.extractURLHost", SQLSTATE(HY013) MAL_MALLOC_FAIL );
+                                                       break;
+                                               }
+                                               continue;
+                                       }
                                }
                        }
                        // fall back insert nil str if no valid host
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to