[gnome-commander] inline quote_if_needed()



commit 8aabd06f51a7d7b2c2e3a00ca35d6923e641b77c
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Thu Aug 12 19:48:17 2010 +0200

    inline quote_if_needed()

 src/gnome-cmd-file.cc |    2 +-
 src/utils.cc          |    7 -------
 src/utils.h           |    7 ++++++-
 3 files changed, 7 insertions(+), 9 deletions(-)
---
diff --git a/src/gnome-cmd-file.cc b/src/gnome-cmd-file.cc
index 415adca..705b538 100644
--- a/src/gnome-cmd-file.cc
+++ b/src/gnome-cmd-file.cc
@@ -409,7 +409,7 @@ gchar *gnome_cmd_file_get_real_path (GnomeCmdFile *f)
 gchar *gnome_cmd_file_get_quoted_real_path (GnomeCmdFile *f)
 {
     gchar *path = gnome_cmd_file_get_real_path (f);
-    gchar *ret = path ? quote_if_needed (path) : NULL;
+    gchar *ret = quote_if_needed (path);
 
     g_free (path);
 
diff --git a/src/utils.cc b/src/utils.cc
index 2ddddf0..9bf75e4 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -855,13 +855,6 @@ const gchar *create_nice_size_str (GnomeVFSFileSize size)
 }
 
 
-gchar *quote_if_needed (const gchar *in)
-{
-    //return strpbrk(in,";&$'\"?")==NULL ? g_strdup (in) : g_strdup_printf ("'%s'", in);
-    return g_shell_quote (in);
-}
-
-
 gchar *unquote_if_needed (const gchar *in)
 {
 
diff --git a/src/utils.h b/src/utils.h
index 9618b8b..5f248c7 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -174,7 +174,12 @@ GList *strings_to_uris (gchar *data);
 
 GnomeVFSFileSize calc_tree_size (const GnomeVFSURI *dir_uri);
 const gchar *create_nice_size_str (GnomeVFSFileSize size);
-gchar *quote_if_needed (const gchar *in);
+
+inline gchar *quote_if_needed (const gchar *in)
+{
+    return g_shell_quote (in);
+}
+
 gchar *unquote_if_needed (const gchar *in);
 
 inline void stop_kp (GtkObject *obj)



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