summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRalf Stephan <ralf@ark.in-berlin.de>2006-07-08 17:23:28 +0000
committerrwst <rwst@users.sourceforge.net>2006-07-08 17:23:28 +0000
commit950f9360f8aeccd7569e1fe51df14494a6d8d58a (patch)
tree8546f9fa27728a7f09b450c19e12131aa57854e8 /src
parentadded gui code for whiteboard (diff)
downloadinkscape-950f9360f8aeccd7569e1fe51df14494a6d8d58a.tar.gz
inkscape-950f9360f8aeccd7569e1fe51df14494a6d8d58a.zip
handle NULL return value, fixes crash when opening filechooser dialog (#1502439)
(bzr r1377)
Diffstat (limited to 'src')
-rw-r--r--src/dialogs/filedialog.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/dialogs/filedialog.cpp b/src/dialogs/filedialog.cpp
index fb6e599a8..6bc56357d 100644
--- a/src/dialogs/filedialog.cpp
+++ b/src/dialogs/filedialog.cpp
@@ -25,6 +25,7 @@
#include <gtk/gtkentry.h>
#include <gtk/gtkexpander.h>
+#include <unistd.h>
#include <sys/stat.h>
#include <glibmm/i18n.h>
#include <gtkmm/box.h>
@@ -1335,14 +1336,16 @@ FileSaveDialogImpl::~FileSaveDialogImpl()
-
/**
* Show this dialog modally. Return true if user hits [OK]
*/
bool
FileSaveDialogImpl::show()
{
- set_current_folder(get_current_folder()); //hack to force initial dir listing
+ Glib::ustring s = Glib::filename_to_utf8 (get_current_folder());
+ if (s.length() == 0)
+ s = getcwd (NULL, 0);
+ set_current_folder(Glib::filename_from_utf8(s)); //hack to force initial dir listing
set_modal (TRUE); //Window
sp_transientize((GtkWidget *)gobj()); //Make transient
gint b = run(); //Dialog