[Commits] utils.c 1.36.2.210 1.36.2.211

colin at claws-mail.org colin at claws-mail.org
Sat Dec 1 22:23:13 CET 2012


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

Modified Files:
      Tag: gtk2
	utils.c 
Log Message:
2012-12-01 [colin]	3.9.0cvs35

	* src/common/utils.c
		As usual, Windows is a little bit different
		(you have to love it the same as the normal OSes...) 

Index: utils.c
===================================================================
RCS file: /home/claws-mail/claws/src/common/utils.c,v
retrieving revision 1.36.2.210
retrieving revision 1.36.2.211
diff -u -d -r1.36.2.210 -r1.36.2.211
--- utils.c	1 Dec 2012 21:03:48 -0000	1.36.2.210
+++ utils.c	1 Dec 2012 21:23:10 -0000	1.36.2.211
@@ -5359,7 +5359,19 @@
 	GSList *cur;
 	gchar *str;
 
+#ifndef G_OS_WIN32
 	result = g_string_append(result, G_DIR_SEPARATOR_S);
+#else
+	if (pathlist->data) {
+		const gchar *root = (gchar *)pathlist->data;
+		if (root[0] != '\0' && g_ascii_isalpha(root[0]) &&
+		    root[1] == ':') {
+			/* drive - don't prepend dir separator */
+		} else {
+			result = g_string_append(result, G_DIR_SEPARATOR_S);
+		}
+	}
+#endif
 
 	for (cur = pathlist; cur; cur = cur->next) {
 		result = g_string_append(result, (gchar *)cur->data);
@@ -5383,7 +5395,11 @@
 	gboolean follow_symlinks = TRUE;
 
 	if (depth > 32) {
+#ifndef G_OS_WIN32
 		errno = ELOOP;
+#else
+		errno = EINVAL; /* can't happen, no symlink handling */
+#endif
 		return NULL;
 	}
 
@@ -5429,6 +5445,7 @@
 					return NULL;
 				}
 			}
+#ifndef G_OS_WIN32
 			if (follow_symlinks && g_file_test(tmp_path, G_FILE_TEST_IS_SYMLINK)) {
 				GError *error = NULL;
 				gchar *target = g_file_read_link(tmp_path, &error);
@@ -5446,6 +5463,7 @@
 				}
 				g_free(target);
 			}
+#endif
 			g_free(tmp_path);
 		}
 	}



More information about the Commits mailing list