[gaim-migrate @ 15322]

Fri, 20 Jan 2006 17:24:54 +0000

author
Richard Laager <rlaager@pidgin.im>
date
Fri, 20 Jan 2006 17:24:54 +0000
changeset 12969
823d3591438c
parent 12968
478a7a56663b
child 12970
c2f3b4dcf711

[gaim-migrate @ 15322]
Checking that the filename (w/o extension) is == 17 characters is a bit restrictive. I'm making this a little more future-proof by checking that the filename is >= 17 characters. I may be appending a timezone designator to the filename at a later point in time, and I'd like those logs readable by all 2.x.y versions of Gaim.

src/log.c file | annotate | diff | comparison | revisions
--- a/src/log.c	Fri Jan 20 03:57:44 2006 +0000
+++ b/src/log.c	Fri Jan 20 17:24:54 2006 +0000
@@ -649,14 +649,17 @@
 	if (path == NULL)
 		return NULL;
 
-	if (!(dir = g_dir_open(path, 0, NULL))) {
+	if (!(dir = g_dir_open(path, 0, NULL)))
+	{
 		g_free(path);
 		return NULL;
 	}
 
-	while ((filename = g_dir_read_name(dir))) {
+	while ((filename = g_dir_read_name(dir)))
+	{
 		if (gaim_str_has_suffix(filename, ext) &&
-				strlen(filename) == 17 + strlen(ext)) {
+		    strlen(filename) >= (17 + strlen(ext)))
+		{
 			GaimLog *log;
 			GaimLogCommonLoggerData *data;
 			time_t stamp = gaim_str_to_time(filename, FALSE);

mercurial