[epiphany] ephy-shell: Don't interpret null arguments as empty string when adding platform data



commit 2180a4f7946178eba9b3654800da2026e624c480
Author: Yetizone <andreii lisita gmail com>
Date:   Sat Feb 8 12:03:02 2020 +0200

    ephy-shell: Don't interpret null arguments as empty string when adding platform data
    
    This caused an inconsistency in ephy_startup_continue():
    ctx->arguments would be null when the primary instance was launched and
    not null when a secondary instance was launched (in both cases the instance
    would be launched without arguments in the CLI, hence the inconsistency).

 src/ephy-shell.c | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)
---
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index 98babe02c..23c52717f 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -531,8 +531,6 @@ ephy_shell_add_platform_data (GApplication    *application,
   EphyShell *app;
   EphyShellStartupContext *ctx;
   GVariantBuilder *ctx_builder;
-  static const char *empty_arguments[] = { "", NULL };
-  const char * const *arguments;
 
   app = EPHY_SHELL (application);
 
@@ -557,18 +555,10 @@ ephy_shell_add_platform_data (GApplication    *application,
                              CTX_SESSION_FILENAME,
                              g_variant_new_string (ctx->session_filename));
 
-    /*
-     * If there are no URIs specified, pass an empty string, so that
-     * the primary instance opens a new window.
-     */
     if (ctx->arguments)
-      arguments = (const gchar * const *)ctx->arguments;
-    else
-      arguments = empty_arguments;
-
-    g_variant_builder_add (ctx_builder, "{iv}",
-                           CTX_ARGUMENTS,
-                           g_variant_new_strv (arguments, -1));
+      g_variant_builder_add (ctx_builder, "{iv}",
+                             CTX_ARGUMENTS,
+                             g_variant_new_strv ((const char **)ctx->arguments, -1));
 
     g_variant_builder_add (ctx_builder, "{iv}",
                            CTX_USER_TIME,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]