From: Colin Leroy Date: Tue, 6 May 2008 06:31:13 +0000 (+0000) Subject: 2008-05-06 [colin] 3.4.0cvs26 X-Git-Tag: rel_3_5_0~94 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=28d76dd1a60b4a477f38157fc7fec35a8c5796d3;ds=sidebyside 2008-05-06 [colin] 3.4.0cvs26 * src/common/utils.c Maybe fix crash on FreeBSD --- diff --git a/ChangeLog b/ChangeLog index 84deabc3d..462782c0e 100644 --- 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 diff --git a/PATCHSETS b/PATCHSETS index a8097664a..923295874 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -3321,3 +3321,4 @@ ( 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 diff --git a/configure.ac b/configure.ac index bc9244f6e..7b304244b 100644 --- a/configure.ac +++ b/configure.ac @@ -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= diff --git a/src/common/utils.c b/src/common/utils.c index 5099be405..f37db2b74 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -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); + } } } }