[PATCH] Fixes incorrect escaping in webdav module

Yann Rouillard <[email protected]>
Newsgroups gmane.comp.gnome.vfs.general
Message-ID <1192984577.5819.10.camel@celaeno>
The attached patch fixes a missing escaping bug in the webdav/neon gnomevfs module.
This bug prevented files with special characters in it to be retrieved from a webdav mount.

The corresponding bugzilla issues are http://bugzilla.gnome.org/show_bug.cgi?id=319349 and http://bugzilla.gnome.org/show_bug.cgi?id=166969

Yann

_______________________________________________
gnome-vfs-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gnome-vfs-list
fix_incorrect_escaping_in_webdav_module.patch (text/x-patch, 1013 B)
Index: modules/http-neon-method.c
===================================================================
--- modules/http-neon-method.c	(révision 5342)
+++ modules/http-neon-method.c	(copie de travail)
@@ -1188,7 +1188,7 @@
 	time_t	time;
 	gulong  size;
 	ne_uri  uri;
-	char *unesc_path;
+	char *unesc_path, *unesc_ctx_path;
 
 	ctx = (PropfindContext *) userdata;
 
@@ -1205,10 +1205,10 @@
 	info = gnome_vfs_file_info_new ();
 	unesc_path = ne_path_unescape (uri.path);
 	info->name = g_path_get_basename (unesc_path);
-	NE_FREE (unesc_path);
 
+	unesc_ctx_path = ne_path_unescape (ctx->path);
 	DEBUG_HTTP_2 ("Comparing: \n\t[%s] \n\t[%s]", ctx->path, uri.path);
-	if (ne_path_compare (ctx->path, uri.path) == 0) {
+	if (ne_path_compare (unesc_ctx_path, unesc_path) == 0) {
 		DEBUG_HTTP_3 ("target");
 		ctx->target = info;
 
@@ -1225,6 +1225,8 @@
 		ctx->children = g_list_append (ctx->children, info);
 	}
 
+	NE_FREE (unesc_ctx_path);
+	NE_FREE (unesc_path);
 	ne_uri_free (&uri);
 
 	/* getlastmodified */
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.