]> source.dussan.org Git - rspamd.git/commitdiff
More fixes to url parser.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 8 Sep 2015 13:12:45 +0000 (14:12 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 8 Sep 2015 13:12:45 +0000 (14:12 +0100)
src/libserver/url.c

index 55f4c30e05ea9253818d30ba1873603abbce8939..fb3e961e680cf1366289646087e27485d276ebbd 100644 (file)
@@ -477,7 +477,7 @@ rspamd_mailto_parse (struct http_parser_url *u, const gchar *str, gsize len,
        }
 
        if (!strict) {
-               return 1;
+               return 0;
        }
 
        return ret;
@@ -1452,7 +1452,6 @@ url_email_start (struct url_callback_data *cb,
                /* We have mailto:// at the beginning */
                match->m_begin = pos;
 
-               return TRUE;
        }
        else {
                /* Just '@' */
@@ -1460,12 +1459,11 @@ url_email_start (struct url_callback_data *cb,
                /* Check if this match is a part of the previous mailto: email */
                if (cb->last_at != NULL && cb->last_at == pos) {
                        cb->last_at = NULL;
+                       return FALSE;
                }
-
-               return FALSE;
        }
 
-       return FALSE;
+       return TRUE;
 }
 
 static gboolean
@@ -1515,7 +1513,7 @@ url_email_end (struct url_callback_data *cb,
                        c --;
                }
                /* Rewind to the first alphanumeric character */
-               while (c < pos && !g_ascii_isalnum (c)) {
+               while (c < pos && !g_ascii_isalnum (*c)) {
                        c ++;
                }