diff options
author | Bram Moolenaar <Bram@vim.org> | 2006-10-10 16:28:30 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2006-10-10 16:28:30 +0000 |
commit | 57ac3a21635afec3066fdbc282ca7d8eb80976cf (patch) | |
tree | 03cf8d3b6aee114217617e7e28577c4099ddc9ab /src/gui_gtk.c | |
parent | da68cf33d83ff54545a209e6b5c1e3eb164e76d7 (diff) | |
download | vim-git-57ac3a21635afec3066fdbc282ca7d8eb80976cf.tar.gz |
updated for version 7.0-129v7.0.129
Diffstat (limited to 'src/gui_gtk.c')
-rw-r--r-- | src/gui_gtk.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gui_gtk.c b/src/gui_gtk.c index 8751615bf..29ef7e367 100644 --- a/src/gui_gtk.c +++ b/src/gui_gtk.c @@ -1275,18 +1275,13 @@ gui_mch_browse(int saving, title = CONVERT_TO_UTF8(title); # endif - /* Concatenate "initdir" and "dflt". */ + /* GTK has a bug, it only works with an absolute path. */ if (initdir == NULL || *initdir == NUL) mch_dirname(dirbuf, MAXPATHL); - else if (STRLEN(initdir) + 2 < MAXPATHL) - STRCPY(dirbuf, initdir); - else + else if (vim_FullName(initdir, dirbuf, MAXPATHL - 2, FALSE) == FAIL) dirbuf[0] = NUL; /* Always need a trailing slash for a directory. */ add_pathsep(dirbuf); - if (dflt != NULL && *dflt != NUL - && STRLEN(dirbuf) + 2 + STRLEN(dflt) < MAXPATHL) - STRCAT(dirbuf, dflt); /* If our pointer is currently hidden, then we should show it. */ gui_mch_mousehide(FALSE); @@ -1341,6 +1336,11 @@ gui_mch_browse(int saving, else gtk_window_set_title(GTK_WINDOW(gui.filedlg), (const gchar *)title); + /* Concatenate "initdir" and "dflt". */ + if (dflt != NULL && *dflt != NUL + && STRLEN(dirbuf) + 2 + STRLEN(dflt) < MAXPATHL) + STRCAT(dirbuf, dflt); + gtk_file_selection_set_filename(GTK_FILE_SELECTION(gui.filedlg), (const gchar *)dirbuf); # ifndef HAVE_GTK2 |