2012-05-16 [colin] 3.8.0cvs44
authorColin Leroy <colin@colino.net>
Wed, 16 May 2012 08:00:56 +0000 (08:00 +0000)
committerColin Leroy <colin@colino.net>
Wed, 16 May 2012 08:00:56 +0000 (08:00 +0000)
* src/common/utils.c
Make remove_numbered_files much faster when there's
just one file to remove.

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

index c6fd359..bc8bc34 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-05-16 [colin]     3.8.0cvs44
+
+       * src/common/utils.c
+               Make remove_numbered_files much faster when there's
+               just one file to remove.
+
 2012-05-16 [paul]      3.8.0cvs43
 
        * src/matcher.c
index 68d8334..3b21402 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.4.2.40 -r 1.4.2.41 src/common/ssl_certificate.c;  ) > 3.8.0cvs41.patchset
 ( cvs diff -u -r 1.5.2.32 -r 1.5.2.33 src/gtk/description_window.c;  ) > 3.8.0cvs42.patchset
 ( cvs diff -u -r 1.75.2.69 -r 1.75.2.70 src/matcher.c;  ) > 3.8.0cvs43.patchset
+( cvs diff -u -r 1.36.2.196 -r 1.36.2.197 src/common/utils.c;  ) > 3.8.0cvs44.patchset
index 25aab8b..ed95db3 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=8
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=43
+EXTRA_VERSION=44
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 3b82ed0..f5e28d6 100644 (file)
@@ -2322,6 +2322,17 @@ gint remove_numbered_files(const gchar *dir, guint first, guint last)
        gchar *prev_dir;
        gint file_no;
 
+       if (first == last) {
+               /* Skip all the dir reading part. */
+               gchar *filename = g_strdup_printf("%s%s%u", dir, G_DIR_SEPARATOR_S, first);
+               if (claws_unlink(filename) < 0) {
+                       FILE_OP_ERROR(filename, "unlink");
+                       g_free(filename);
+                       return -1;
+               }
+               return 0;
+       }
+
        prev_dir = g_get_current_dir();
 
        if (g_chdir(dir) < 0) {