Fixes from Steffen Eschenbacher:
authorTor Lillqvist <tml@novell.com>
Thu, 5 Oct 2006 14:16:39 +0000 (14:16 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Thu, 5 Oct 2006 14:16:39 +0000 (14:16 +0000)
2006-10-05  Tor Lillqvist  <tml@novell.com>

Fixes from Steffen Eschenbacher:

* camel-stream-vfs.c (camel_stream_vfs_finalize): Call
gnome_vfs_close() on the GnomeVFSHandle *, not close(). (#350576,
#350885, #358010)

* camel-url.c (camel_url_new_with_base, camel_url_to_string): On
Win32, for file: urls, simply call g_filename_{to/from}_uri.
(#358010) We could do this on all platforms maybe?

camel/ChangeLog
camel/camel-stream-vfs.c
camel/camel-url.c

index 0f69f36..b8a2bde 100644 (file)
@@ -1,3 +1,15 @@
+2006-10-05  Tor Lillqvist  <tml@novell.com>
+
+       Fixes from Steffen Eschenbacher:
+
+       * camel-stream-vfs.c (camel_stream_vfs_finalize): Call
+       gnome_vfs_close() on the GnomeVFSHandle *, not close(). (#350576,
+       #350885, #358010)
+
+       * camel-url.c (camel_url_new_with_base, camel_url_to_string): On
+       Win32, for file: urls, simply call g_filename_{to/from}_uri.
+       (#358010) We could do this on all platforms maybe?
+
 2006-09-14  Veerapuram Varadhan  <vvaradhan@novell.com> 
 
        ** Fixes bug #350907
index 078c715..389be67 100644 (file)
@@ -84,7 +84,7 @@ camel_stream_vfs_finalize (CamelObject *object)
        CamelStreamVFS *stream_vfs = CAMEL_STREAM_VFS (object);
 
        if (stream_vfs->handle != -1)
-               close (stream_vfs->handle);
+               gnome_vfs_close (stream_vfs->handle);
 }
 
 
index 34224a3..69ffc66 100644 (file)
@@ -57,10 +57,12 @@ CamelURL *
 camel_url_new_with_base (CamelURL *base, const char *url_string)
 {
        CamelURL *url;
+       const char *start;
        const char *end, *hash, *colon, *semi, *at, *slash, *question;
        const char *p;
 
        url = g_new0 (CamelURL, 1);
+       start = url_string;
 
        /* See RFC1808 for details. IF YOU CHANGE ANYTHING IN THIS
         * FUNCTION, RUN tests/misc/url AFTERWARDS.
@@ -91,6 +93,13 @@ camel_url_new_with_base (CamelURL *base, const char *url_string)
        if (!*url_string && !base)
                return url;
 
+#ifdef G_OS_WIN32
+       if (url->protocol && !strcmp(url->protocol, "file")) {
+               url->path = g_filename_from_uri(start, &url->host, NULL);
+               return url;
+       }
+#endif
+
        /* Check for authority */
        if (strncmp (url_string, "//", 2) == 0) {
                url_string += 2;
@@ -316,6 +325,11 @@ camel_url_to_string (CamelURL *url, guint32 flags)
         * tests/misc/url AFTERWARD.
         */
        
+#ifdef G_OS_WIN32
+       if (url->protocol && !strcmp(url->protocol, "file"))
+               return g_filename_to_uri(url->path, url->host, NULL);
+#endif G_OS_WIN32
+       
        str = g_string_sized_new (20);
        
        if (url->protocol)