filename | src/gtkui/gtkui.c |
changeset | 630:50addb748df5 |
prev | 622:3554650afb26 |
next | 658:f5926310bfbe |
author | nkeynes |
date | Tue Feb 12 08:36:29 2008 +0000 (16 years ago) |
permissions | -rw-r--r-- |
last change | Bug #55: Fix relative path handling Canonicalize paths before passing to the file dialog |
file | annotate | diff | log | raw |
1.1 --- a/src/gtkui/gtkui.c Thu Jan 31 00:19:20 2008 +00001.2 +++ b/src/gtkui/gtkui.c Tue Feb 12 08:36:29 2008 +00001.3 @@ -515,6 +515,20 @@1.4 return keyval;1.5 }1.7 +gchar *get_absolute_path( const gchar *in_path )1.8 +{1.9 + char tmp[PATH_MAX];1.10 + if( in_path == NULL ) {1.11 + return NULL;1.12 + }1.13 + if( in_path[0] == '/' || in_path[0] == 0 ) {1.14 + return g_strdup(in_path);1.15 + } else {1.16 + getcwd(tmp, sizeof(tmp));1.17 + return g_strdup_printf("%s%c%s", tmp, G_DIR_SEPARATOR, in_path);1.18 + }1.19 +}1.20 +1.21 /************* X11-specificness **********/1.22 #include <gdk/gdkx.h>
.