]> git.armaanb.net Git - chorizo.git/commitdiff
Call ensure_uri_scheme() before sending message to socket
authorPeter Hofmann <scm@uninformativ.de>
Sat, 11 Mar 2017 16:32:22 +0000 (17:32 +0100)
committerPeter Hofmann <scm@uninformativ.de>
Sat, 11 Mar 2017 16:32:22 +0000 (17:32 +0100)
The main process and the process that sends the message might have
different working directories. As a result, the main process might not
be able to detect "foo.html" as a file when called as "lariza foo.html".

CHANGES
browser.c

diff --git a/CHANGES b/CHANGES
index 1a7038c187a8ccf5717401f028515236df6563d3..c73601aa1347ae859c0e3a5500eac1b5b734a9a5 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,10 @@
 Release history for lariza
 
+next
+  [Fixed]
+  - Automatically adding the "file://" prefix didn't work (reliably) if
+    a message was sent to an already running instance.
+
 v17.02  2017-02-16
   [Fixed]
   - As requested by WebKit's API documentation, we now wait for the
index a4391dc365891549c8e7fd7018590c630fac8d88..112c698406472393ad2204a7d284fb1202a72c8e 100644 (file)
--- a/browser.c
+++ b/browser.c
@@ -121,8 +121,10 @@ client_new(const gchar *uri, WebKitWebView *related_wv, gboolean show)
 
     if (uri != NULL && cooperative_instances && !cooperative_alone)
     {
-        write(cooperative_pipe_fp, uri, strlen(uri));
+        f = ensure_uri_scheme(uri);
+        write(cooperative_pipe_fp, f, strlen(f));
         write(cooperative_pipe_fp, "\n", 1);
+        g_free(f);
         return NULL;
     }