Fix gis_http_available bugs
authorAndy Spencer <andy753421@gmail.com>
Mon, 26 Apr 2010 04:49:44 +0000 (04:49 +0000)
committerAndy Spencer <andy753421@gmail.com>
Mon, 26 Apr 2010 04:49:44 +0000 (04:49 +0000)
- Used wrong RE
- Used wrong subexpression reference

src/data/gis-http.c

index d017013..613dd43 100644 (file)
@@ -233,9 +233,9 @@ GList *gis_http_available(GisHttp *http,
                GRegex *extract_re = g_regex_new(
                                extract ?: "href=\"([^\"]*)\"", 0, 0, NULL);
                GMatchInfo *info;
-               g_regex_match(filter_re, html, 0, &info);
+               g_regex_match(extract_re, html, 0, &info);
                while (g_match_info_matches(info)) {
-                       gchar *file = g_match_info_fetch(info, 0);
+                       gchar *file = g_match_info_fetch(info, 1);
                        if (g_regex_match(filter_re, file, 0, NULL))
                                files = g_list_prepend(files, file);
                        else