]> Pileus Git - grits/blobdiff - src/data/gis-http.c
Win32 port
[grits] / src / data / gis-http.c
index 613dd439fa7ce38f7c55486415cf5a1a8cc8d15a..b5259e47108e15a92f0f95b44c24d4b19828a873 100644 (file)
@@ -125,7 +125,6 @@ gchar *gis_http_fetch(GisHttp *http, const gchar *uri, const char *local,
 {
        g_debug("GisHttp: fetch - %s... >> %s/%s  mode=%d",
                        uri, http->prefix, local, mode);
-
        gchar *path = _get_cache_path(http, local);
 
        /* Unlink the file if we're refreshing it */
@@ -141,7 +140,8 @@ gchar *gis_http_fetch(GisHttp *http, const gchar *uri, const char *local,
                gchar *part = path;
                if (!g_file_test(path, G_FILE_TEST_EXISTS))
                        part = g_strdup_printf("%s.part", path);
-               FILE *fp = fopen_p(part, "a");
+               FILE *fp = fopen_p(part, "ab");
+               fseek(fp, 0, SEEK_END); // "a" is broken on Windows, twice
 
                /* Make temp data */
                struct _CacheInfo info = {
@@ -178,6 +178,7 @@ gchar *gis_http_fetch(GisHttp *http, const gchar *uri, const char *local,
                }
        }
 
+
        /* TODO: free everything.. */
        return path;
 }
@@ -219,7 +220,6 @@ GList *gis_http_available(GisHttp *http,
                g_free(path);
        }
 
-
        /* Add online files if online */
        if (index) {
                gchar tmp[16];