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 84deabc3dd3a7e023f5bf634845695ffd821a4b7..462782c0eb13f22845967b0f4c655384cb292cbf 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 a8097664a8228b91bfcd07d766e0fac8baa127af..92329587410a67053e019b127706c7d52e51a7b1 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 bc9244f6ef1962bfe9ffbfa146128411ef566d9b..7b304244b5a07399a612d5fbc5a12d7d1025bd98 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 5099be405160815495b15a777b6afccedfe5e3ac..f37db2b74d69630dc6cea0634beb6ac3346029ce 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);
+                               }
                        }
                }
        }