]> spindle.queued.net Git - midori/commitdiff
Don't use g_access, use the return value of g_file_get_contents
authorAlexander Butenko <a.butenka@gmail.com>
Mon, 21 Dec 2009 22:24:27 +0000 (23:24 +0100)
committerChristian Dywan <christian@twotoasts.de>
Mon, 21 Dec 2009 22:27:00 +0000 (23:27 +0100)
extensions/formhistory.c

index 334237ec08e3657b7a95064f623746a7bca88890..fbf05774dc653a2aa9496370bc61d38584b9dc46 100644 (file)
@@ -37,16 +37,14 @@ formhistory_prepare_js ()
    gchar* file;
 
    gchar* data_path = g_build_filename (MDATADIR, PACKAGE_NAME, "res", NULL);
-   file = g_build_filename (data_path,"/autosuggestcontrol.js",NULL);
-   if (g_access (file, F_OK) != 0)
+   file = g_build_filename (data_path, G_DIR_SEPARATOR_S, "autosuggestcontrol.js",NULL);
+   if (!g_file_get_contents (file, &autosuggest, NULL, NULL))
        return FALSE;
-   g_file_get_contents (file, &autosuggest, NULL, NULL);
    g_strchomp (autosuggest);
 
-   file = g_build_filename (data_path,"/autosuggestcontrol.css",NULL);
-   if (g_access (file, F_OK) != 0)
+   file = g_build_filename (data_path, G_DIR_SEPARATOR_S, "autosuggestcontrol.css",NULL);
+   if(!g_file_get_contents (file, &style, NULL, NULL))
        return FALSE;
-   g_file_get_contents (file, &style, NULL, NULL);
    g_strchomp (style);
    i = 0;
    while (style[i])