Don't use g_access, use the return value of g_file_get_contents
This commit is contained in:
parent
613979a579
commit
dc288dd3c3
1 changed files with 4 additions and 6 deletions
|
@ -37,16 +37,14 @@ formhistory_prepare_js ()
|
||||||
gchar* file;
|
gchar* file;
|
||||||
|
|
||||||
gchar* data_path = g_build_filename (MDATADIR, PACKAGE_NAME, "res", NULL);
|
gchar* data_path = g_build_filename (MDATADIR, PACKAGE_NAME, "res", NULL);
|
||||||
file = g_build_filename (data_path,"/autosuggestcontrol.js",NULL);
|
file = g_build_filename (data_path, G_DIR_SEPARATOR_S, "autosuggestcontrol.js",NULL);
|
||||||
if (g_access (file, F_OK) != 0)
|
if (!g_file_get_contents (file, &autosuggest, NULL, NULL))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
g_file_get_contents (file, &autosuggest, NULL, NULL);
|
|
||||||
g_strchomp (autosuggest);
|
g_strchomp (autosuggest);
|
||||||
|
|
||||||
file = g_build_filename (data_path,"/autosuggestcontrol.css",NULL);
|
file = g_build_filename (data_path, G_DIR_SEPARATOR_S, "autosuggestcontrol.css",NULL);
|
||||||
if (g_access (file, F_OK) != 0)
|
if(!g_file_get_contents (file, &style, NULL, NULL))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
g_file_get_contents (file, &style, NULL, NULL);
|
|
||||||
g_strchomp (style);
|
g_strchomp (style);
|
||||||
i = 0;
|
i = 0;
|
||||||
while (style[i])
|
while (style[i])
|
||||||
|
|
Loading…
Reference in a new issue