Fix format string error in win32 logging, and
authorColin Leroy <colin@colino.net>
Wed, 20 Mar 2013 10:28:22 +0000 (11:28 +0100)
committerColin Leroy <colin@colino.net>
Wed, 20 Mar 2013 10:28:22 +0000 (11:28 +0100)
uncomment logging in fancy

src/main.c
src/plugins/fancy/fancy_viewer.c

index e2e82dfd3297c64d1d0c0f22656a663dbe6f0ab6..bfccaa04d3b9c808e1a132f070b793eafc2cdd31 100644 (file)
@@ -773,7 +773,7 @@ static guint win32_log_handler_gtk_id;
 static void win32_print_stdout(const gchar *string)
 {
        if (win32_debug_fp) {
-               fprintf(win32_debug_fp, string);
+               fprintf(win32_debug_fp, "%s", string);
                fflush(win32_debug_fp);
        }
 }
@@ -781,7 +781,7 @@ static void win32_print_stdout(const gchar *string)
 static void win32_print_stderr(const gchar *string)
 {
        if (win32_debug_fp) {
-               fprintf(win32_debug_fp, string);
+               fprintf(win32_debug_fp, "%s", string);
                fflush(win32_debug_fp);
        }
 }
index 2bd9d0bf4cf307891331eac239401644314449ed..642aa8e1be22072cc454065d9506249907765f3e 100644 (file)
@@ -377,9 +377,9 @@ navigation_requested_cb(WebKitWebView *view, WebKitWebFrame *frame,
                                                WebKitNetworkRequest *netreq, FancyViewer *viewer)
 {
        const gchar *uri = webkit_network_request_get_uri(netreq);
-#ifndef G_OS_WIN32
+
        debug_print("navigation requested to %s\n", uri);
-#endif
+
        if (!strncmp(uri, "mailto:", 7)) {
                compose_new(NULL, uri + 7, NULL);
                return WEBKIT_NAVIGATION_RESPONSE_IGNORE;
@@ -432,16 +432,12 @@ static void resource_request_starting_cb(WebKitWebView            *view,
        /* refresh URI that may have changed */
        uri = webkit_network_request_get_uri(request);
        if (!viewer->override_prefs_remote_content
-           && strncmp(uri, "file://", 7)) {
-#ifndef G_OS_WIN32
+           && strncmp(uri, "file://", 7) && strncmp(uri, "data:", 5)) {
                debug_print("Preventing load of %s\n", uri);
-#endif
                webkit_network_request_set_uri(request, "about:blank");
        }
-#ifndef G_OS_WIN32
        else
-               debug_print("Starting request of %s\n", uri);
-#endif
+               debug_print("Starting request of %d %s\n", strlen(uri), uri);
 }
 
 static gboolean fancy_text_search(MimeViewer *_viewer, gboolean backward,