From 995eaac10bc64a69a0adb466e05c02b8d1005cf9 Mon Sep 17 00:00:00 2001 From: mfranz Date: Sun, 19 Oct 2008 16:25:05 +0000 Subject: [PATCH] screenshots: check for empty screenshots-dir --- src/GUI/gui_funcs.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/GUI/gui_funcs.cxx b/src/GUI/gui_funcs.cxx index 6b4e86933..574611196 100644 --- a/src/GUI/gui_funcs.cxx +++ b/src/GUI/gui_funcs.cxx @@ -486,7 +486,10 @@ bool fgDumpSnapShot () { renderer->update( true ); renderer->update( true ); - string dir = fgGetString("/sim/paths/screenshot-dir", fgGetString("/sim/fg-current")); + string dir = fgGetString("/sim/paths/screenshot-dir"); + if (dir.empty()) + dir = fgGetString("/sim/fg-current"); + SGPath path(dir + '/'); if (path.create_dir( 0755 )) { SG_LOG(SG_GENERAL, SG_ALERT, "Cannot create screenshot directory '" -- 2.39.5