[Xfce4-commits] [thunar-plugins/thunar-vcs-plugin] 01/03: Don't strip root '/' as trailing

noreply at xfce.org noreply at xfce.org
Mon Feb 16 20:02:59 CET 2015


This is an automated email from the git hooks/post-receive script.

peter pushed a commit to branch master
in repository thunar-plugins/thunar-vcs-plugin.

commit cf27cb4d0069d54854b887b723f661ba24c53111
Author: Peter de Ridder <peter at xfce.org>
Date:   Mon Feb 16 10:48:17 2015 +0100

    Don't strip root '/' as trailing
---
 thunar-vcs-plugin/tvp-git-action.c  |    2 +-
 thunar-vcs-plugin/tvp-provider.c    |    4 ++--
 thunar-vcs-plugin/tvp-svn-action.c  |    2 +-
 thunar-vcs-plugin/tvp-svn-backend.c |    6 +++---
 tvp-svn-helper/tsh-common.c         |    2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/thunar-vcs-plugin/tvp-git-action.c b/thunar-vcs-plugin/tvp-git-action.c
index 422c973..10d60ad 100644
--- a/thunar-vcs-plugin/tvp-git-action.c
+++ b/thunar-vcs-plugin/tvp-git-action.c
@@ -364,7 +364,7 @@ static void tvp_action_exec (GtkAction *item, TvpGitAction *tvp_action)
                 file = g_strdup (file);
 
                 /* remove trailing '/' cause git can't handle that */
-                if (file[strlen (file) - 1] == '/')
+                if (strlen (file) > 1 && file[strlen (file) - 1] == '/')
                 {
                     file[strlen (file) - 1] = '\0';
                 }
diff --git a/thunar-vcs-plugin/tvp-provider.c b/thunar-vcs-plugin/tvp-provider.c
index 2735526..d8ce5c9 100644
--- a/thunar-vcs-plugin/tvp-provider.c
+++ b/thunar-vcs-plugin/tvp-provider.c
@@ -325,13 +325,13 @@ tvp_compare_filename (const gchar *uri1, const gchar *uri2)
   path2 = g_strdup (uri2);
 
   /* remove trailing '/' */
-  if (path1[strlen (path1) - 1] == '/')
+  if (strlen (path1) > 1 && path1[strlen (path1) - 1] == '/')
   {
     path1[strlen (path1) - 1] = '\0';
   }
 
   /* remove trailing '/'*/
-  if (path2[strlen (path2) - 1] == '/')
+  if (strlen (path2) > 1 && path2[strlen (path2) - 1] == '/')
   {
     path2[strlen (path2) - 1] = '\0';
   }
diff --git a/thunar-vcs-plugin/tvp-svn-action.c b/thunar-vcs-plugin/tvp-svn-action.c
index a8619e6..e87fbaa 100644
--- a/thunar-vcs-plugin/tvp-svn-action.c
+++ b/thunar-vcs-plugin/tvp-svn-action.c
@@ -517,7 +517,7 @@ static void tvp_action_exec (GtkAction *item, TvpSvnAction *tvp_action)
         file = g_strdup (file);
 
         /* remove trailing '/' cause svn can't handle that */
-        if (file[strlen (file) - 1] == '/')
+        if (strlen (file) > 1 && file[strlen (file) - 1] == '/')
         {
           file[strlen (file) - 1] = '\0';
         }
diff --git a/thunar-vcs-plugin/tvp-svn-backend.c b/thunar-vcs-plugin/tvp-svn-backend.c
index b235487..fb44019 100644
--- a/thunar-vcs-plugin/tvp-svn-backend.c
+++ b/thunar-vcs-plugin/tvp-svn-backend.c
@@ -147,7 +147,7 @@ tvp_svn_backend_is_working_copy (const gchar *uri)
   path = g_strdup (uri);
 
   /* remove trailing '/' cause svn_wc_check_wc can't handle that */
-  if (path[strlen (path) - 1] == '/')
+  if (strlen (path) > 1 && path[strlen (path) - 1] == '/')
   {
     path[strlen (path) - 1] = '\0';
   }
@@ -241,7 +241,7 @@ tvp_svn_backend_get_status (const gchar *uri)
   path = g_strdup (uri);
 
   /* remove trailing '/' cause svn_client_status2 can't handle that */
-  if (path[strlen (path) - 1] == '/')
+  if (strlen (path) > 1 && path[strlen (path) - 1] == '/')
   {
     path[strlen (path) - 1] = '\0';
   }
@@ -339,7 +339,7 @@ tvp_svn_backend_get_info (const gchar *uri)
   path = g_strdup (uri);
 
   /* remove trailing '/' cause svn_client_info can't handle that */
-  if (path[strlen (path) - 1] == '/')
+  if (strlen (path) > 1 && path[strlen (path) - 1] == '/')
   {
     path[strlen (path) - 1] = '\0';
   }
diff --git a/tvp-svn-helper/tsh-common.c b/tvp-svn-helper/tsh-common.c
index fa6cc15..38f4266 100644
--- a/tvp-svn-helper/tsh-common.c
+++ b/tvp-svn-helper/tsh-common.c
@@ -1173,7 +1173,7 @@ tsh_is_working_copy (const gchar *uri, apr_pool_t *pool)
   path = g_strdup (uri);
 
   /* remove trailing '/' cause svn_wc_check_wc can't handle that */
-  if (path[strlen (path) - 1] == '/')
+  if (strlen (path) > 1 && path[strlen (path) - 1] == '/')
   {
     path[strlen (path) - 1] = '\0';
   }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list