[Webkit-unassigned] [Bug 36227] [GTK] Failing tests http/tests/misc/image-blocked-src-change.html & http/tests/misc/image-blocked-src-no-change.html

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Mar 18 03:12:52 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=36227





--- Comment #3 from Sergio Villar Senin <svillar at igalia.com>  2010-03-18 03:12:53 PST ---
(In reply to comment #2)
> (From update of attachment 50922 [details])
> >+    const gchar* uriScheme;
> >+
> >+    // Tests expect only the filename part of local URIs
> >+    uriScheme = g_strstr_len(message, -1, "file://");
> >+    if (uriScheme) {
> >+        GString* tempString = g_string_sized_new(strlen(message));
> >+        gchar* filename = g_strrstr(uriScheme, G_DIR_SEPARATOR_S);
> >+
> >+        if (filename) {
> >+            filename++;
> >+            tempString = g_string_append_len(tempString, message, (uriScheme - message));
> >+            tempString = g_string_append_len(tempString, filename, strlen(filename));
> >+            testMessage = g_string_free(tempString, FALSE);
> >+        }
> 
> You are assuming that there's only one file:// and that it will be the last
> thing in the string, right? The first assumption seems to be shared by all
> DRTs, but not the second one, so perhaps you should find the last separator
> going forward from file:// ? You could just jump to the first whitespace and
> then either do it manually or use g_path_get_basename, I guess.

I'm indeed assuming that there is only one "file://" but nothing more IMHO. In 

tempString = g_string_append_len(tempString, filename, strlen(filename));

I'm appending everything starting from the filename, so if there is anything
more after the filename it will be copied as strlen(filename) will not stop
until the end of the "message" string is found. Or maybe I'm not getting your
point...

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list