[file-roller: 72/123] fixed extration when the base_dir is null



commit e140488b608cdacf5e1292fefccca1ca3b3a53a7
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sun Jul 29 15:55:54 2012 +0200

    fixed extration when the base_dir is null

 src/glib-utils.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/glib-utils.c b/src/glib-utils.c
index 1904482..7505917 100644
--- a/src/glib-utils.c
+++ b/src/glib-utils.c
@@ -1002,8 +1002,8 @@ _g_path_is_parent_of (const char *dirname,
 
 const char *
 _g_path_get_basename (const char *path,
-		       const char *base_dir,
-		       gboolean    junk_paths)
+		      const char *base_dir,
+		      gboolean    junk_paths)
 {
 	int         base_dir_len;
 	const char *base_path;
@@ -1011,6 +1011,9 @@ _g_path_get_basename (const char *path,
 	if (junk_paths)
 		return _g_path_get_file_name (path);
 
+	if (base_dir == NULL)
+		return (path[0] == '/') ? path + 1 : path;
+
 	base_dir_len = strlen (base_dir);
 	if (strlen (path) <= base_dir_len)
 		return NULL;



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