[nautilus: 1/2] nautilus-application: Error out if "x-nautilus-search" is entered from CLI



commit c48d2de6722949b745f90f7f78fe66062e2cab28
Author: Rahul Verma <rv404674 gmail com>
Date:   Wed Mar 21 15:05:14 2018 +0530

    nautilus-application: Error out if "x-nautilus-search" is entered from CLI
    
    The problem is that upon entering "x-nautilus-search" in cli a crash is observed.
    
    The solution is to explicitly check for "x-nautilus-search" in cli and error out before even opening the 
uri.
    
    Closes https://gitlab.gnome.org/GNOME/nautilus/issues/237

 src/nautilus-application.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
---
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index 202ba1322..915a1e9d9 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -984,7 +984,20 @@ nautilus_application_handle_file_args (NautilusApplication *self,
                 file = g_file_new_for_commandline_arg_and_cwd (remaining[idx], cwd);
                 g_free (cwd);
             }
-            g_ptr_array_add (file_array, file);
+
+            if (nautilus_is_search_directory (file))
+            {
+                g_autofree char *error_string = NULL;
+                error_string = g_strdup_printf (_("ā€œ%sā€ is an internal protocol. "
+                                                  "Opening this location directly is not supported."),
+                                                EEL_SEARCH_URI);
+
+                g_printerr ("%s\n", error_string);
+            }
+            else
+            {
+                g_ptr_array_add (file_array, file);
+            }
         }
     }
     else if (g_variant_dict_contains (options, "new-window"))


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