Skip to content
Snippets Groups Projects
Commit 630a6f5e authored by George Kiagiadakis's avatar George Kiagiadakis
Browse files

configuration: convert file paths from relative to absolute if necessary

parent 55a6d20d
No related branches found
No related tags found
No related merge requests found
......@@ -282,6 +282,7 @@ wp_configuration_reload (WpConfiguration *self, const char *extension)
GDir *conf_dir = NULL;
GError *error = NULL;
const gchar *file_name = NULL;
g_autofree gchar *cwd = g_get_current_dir ();
g_return_if_fail (WP_IS_CONFIGURATION (self));
......@@ -330,7 +331,10 @@ wp_configuration_reload (WpConfiguration *self, const char *extension)
while ((file_name = g_dir_read_name (conf_dir))) {
/* Only parse files that have the proper extension */
if (g_str_has_suffix (file_name, ext)) {
g_autofree gchar * location = g_build_filename (path, file_name, NULL);
g_autofree gchar * location =
g_path_is_absolute (path) ?
g_build_filename (path, file_name, NULL) :
g_build_filename (cwd, path, file_name, NULL);
wp_debug_object (self, "loading config file: %s", location);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment