From: John Darrington Date: Wed, 15 Apr 2009 23:55:25 +0000 (+0800) Subject: Avoid warnings when opening a new system file. X-Git-Tag: v0.7.3~157 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7585d6b0837a2864bfc33c5752c9c4b50a50ea37;p=pspp-builds.git Avoid warnings when opening a new system file. --- diff --git a/src/ui/gui/psppire-data-window.c b/src/ui/gui/psppire-data-window.c index 52ec0d49..02b9cc34 100644 --- a/src/ui/gui/psppire-data-window.c +++ b/src/ui/gui/psppire-data-window.c @@ -404,7 +404,17 @@ sysfile_chooser_dialog (PsppireWindow *toplevel) gchar *filename = NULL; g_object_get (toplevel, "filename", &filename, NULL); - dir_name = g_path_get_dirname (filename); + if ( ! g_path_is_absolute (filename)) + { + gchar *path = + g_build_filename (g_get_current_dir (), filename, NULL); + dir_name = g_path_get_dirname (path); + g_free (path); + } + else + { + dir_name = g_path_get_dirname (filename); + } gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), dir_name); free (dir_name);