[Commits] utils.c 1.36.2.196 1.36.2.197

colin at claws-mail.org colin at claws-mail.org
Wed May 16 10:00:57 CEST 2012


Update of /home/claws-mail/claws/src/common
In directory srv:/tmp/cvs-serv20231/src/common

Modified Files:
      Tag: gtk2
	utils.c 
Log Message:
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.

Index: utils.c
===================================================================
RCS file: /home/claws-mail/claws/src/common/utils.c,v
retrieving revision 1.36.2.196
retrieving revision 1.36.2.197
diff -u -d -r1.36.2.196 -r1.36.2.197
--- utils.c	11 May 2012 16:53:23 -0000	1.36.2.196
+++ utils.c	16 May 2012 08:00:55 -0000	1.36.2.197
@@ -2322,6 +2322,17 @@
 	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) {



More information about the Commits mailing list