[Cxplorer-cvs 01329] CVS update: libcxp/src

Back to archive index

Yasumichi Akahoshi yasum****@users*****
2005年 10月 7日 (金) 04:46:40 JST


Index: libcxp/src/cxp-utils.c
diff -u libcxp/src/cxp-utils.c:1.20 libcxp/src/cxp-utils.c:1.21
--- libcxp/src/cxp-utils.c:1.20	Mon Oct  3 00:34:20 2005
+++ libcxp/src/cxp-utils.c	Fri Oct  7 04:46:40 2005
@@ -1,4 +1,4 @@
-/* $Id: cxp-utils.c,v 1.20 2005/10/02 15:34:20 yasumichi Exp $ */
+/* $Id: cxp-utils.c,v 1.21 2005/10/06 19:46:40 yasumichi Exp $ */
 /**
  * \if japanese
  * @file
@@ -6,7 +6,7 @@
  *
  * @author 赤星 柔充
  * @date Fri Jan 21 2005
- * $Revision: 1.20 $
+ * $Revision: 1.21 $
  * \endif
  * \if english
  * @file
@@ -14,7 +14,7 @@
  *
  * @author Yasumichi Akahoshi
  * @date Fri Jan 21 2005
- * $Revision: 1.20 $
+ * $Revision: 1.21 $
  * \endif
  */
 
@@ -195,7 +195,14 @@
  */
 void cxp_utils_set_filename_filter (const gchar *value)
 {
-	fname_filter = g_strdup (value);
+	if ((value != NULL) && (strlen(value) > 0))
+	{
+		if (fname_filter != NULL)
+		{
+			g_free (fname_filter);
+		}
+		fname_filter = g_strdup (value);
+	}
 }
 
 /**
@@ -297,9 +304,15 @@
 	{
 		base_name = g_path_get_basename (file_name);
 		cmd = g_strdup_printf ("%s '%s'", fname_filter, base_name);
-		g_spawn_command_line_sync (cmd, &basename_locale, NULL, NULL, NULL);
+		if( g_spawn_command_line_sync (cmd, &basename_locale, NULL, NULL, NULL) )
+		{
+			g_strchomp (basename_locale);
+		}
+		else
+		{
+			basename_locale = g_path_get_basename (file_name);
+		}
 		g_free (cmd);
-		g_strchomp (basename_locale);
 	}
 	basename_utf8 =
 		g_locale_to_utf8 (basename_locale, -1, NULL, NULL, NULL);


Cxplorer-cvs メーリングリストの案内
Back to archive index