[Xfce4-commits] <midori:master> Don't use g_access, use the return value of g_file_get_contents

Christian Dywan noreply at xfce.org
Tue Dec 22 00:20:03 CET 2009


Updating branch refs/heads/master
         to dc288dd3c35136e9c301919f52b1249eb8629b8d (commit)
       from 613979a57906693099948f61c7ee295680a410df (commit)

commit dc288dd3c35136e9c301919f52b1249eb8629b8d
Author: Alexander Butenko <a.butenka at gmail.com>
Date:   Mon Dec 21 23:24:27 2009 +0100

    Don't use g_access, use the return value of g_file_get_contents

 extensions/formhistory.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/extensions/formhistory.c b/extensions/formhistory.c
index 334237e..fbf0577 100644
--- a/extensions/formhistory.c
+++ b/extensions/formhistory.c
@@ -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])



More information about the Xfce4-commits mailing list