2008-05-06 [colin] 3.4.0cvs26
authorColin Leroy <colin@colino.net>
Tue, 6 May 2008 06:31:13 +0000 (06:31 +0000)
committerColin Leroy <colin@colino.net>
Tue, 6 May 2008 06:31:13 +0000 (06:31 +0000)
* src/common/utils.c
Maybe fix crash on FreeBSD

ChangeLog
PATCHSETS
configure.ac
src/common/utils.c

index 84deabc..462782c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-05-06 [colin]     3.4.0cvs26
+
+       * src/common/utils.c
+               Maybe fix crash on FreeBSD
+
 2008-05-05 [colin]     3.4.0cvs25
 
        * src/messageview.c
index a809766..9232958 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.382.2.446 -r 1.382.2.447 src/compose.c;  cvs diff -u -r 1.204.2.167 -r 1.204.2.168 src/prefs_common.c;  ) > 3.4.0cvs23.patchset
 ( cvs diff -u -r 1.83.2.128 -r 1.83.2.129 src/mimeview.c;  ) > 3.4.0cvs24.patchset
 ( cvs diff -u -r 1.94.2.175 -r 1.94.2.176 src/messageview.c;  ) > 3.4.0cvs25.patchset
+( cvs diff -u -r 1.36.2.138 -r 1.36.2.139 src/common/utils.c;  ) > 3.4.0cvs26.patchset
index bc9244f..7b30424 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=4
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=25
+EXTRA_VERSION=26
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 5099be4..f37db2b 100644 (file)
@@ -5022,24 +5022,26 @@ int claws_unlink(const gchar *filename)
        if (filename == NULL)
                return 0;
 
-       if (found_shred == -1) {
-               /* init */
-               args[0] = g_find_program_in_path("shred");
-               debug_print("found shred: %s\n", args[0]);
-               found_shred = (args[0] != NULL) ? 1:0;
-               args[1] = "-f";
-               args[3] = NULL;
-       }
-       if (found_shred == 1 && prefs_common_get_use_shred()) {
-               if (is_file_exist(filename) && g_stat(filename, &s) == 0) {
-                       if (s.st_nlink == 1) {
-                               gint status=0;
-                               args[2] = filename;
-                               g_spawn_sync(NULL, (gchar **)args, NULL, 0,
-                                NULL, NULL, NULL, NULL, &status, NULL);
-                               debug_print("%s %s exited with status %d\n",
-                                       args[0], filename, WEXITSTATUS(status));
-                               truncate(filename, 0);
+       if (prefs_common_get_use_shred()) {
+               if (found_shred == -1) {
+                       /* init */
+                       args[0] = g_find_program_in_path("shred");
+                       debug_print("found shred: %s\n", args[0]);
+                       found_shred = (args[0] != NULL) ? 1:0;
+                       args[1] = "-f";
+                       args[3] = NULL;
+               }
+               if (found_shred == 1) {
+                       if (g_stat(filename, &s) == 0 && S_ISREG(s.st_mode)) {
+                               if (s.st_nlink == 1) {
+                                       gint status=0;
+                                       args[2] = filename;
+                                       g_spawn_sync(NULL, (gchar **)args, NULL, 0,
+                                        NULL, NULL, NULL, NULL, &status, NULL);
+                                       debug_print("%s %s exited with status %d\n",
+                                               args[0], filename, WEXITSTATUS(status));
+                                       truncate(filename, 0);
+                               }
                        }
                }
        }