diff --git a/src/qtgui/preview_w.cpp b/src/qtgui/preview_w.cpp index 231ecb0c..9ead240b 100644 --- a/src/qtgui/preview_w.cpp +++ b/src/qtgui/preview_w.cpp @@ -832,7 +832,7 @@ bool Preview::loadDocInCurrentTab(const Rcl::Doc &idoc, int docnum) // If the command wants a file but this is not a file url, or // there is an ipath that it won't understand, we need a temp file: - theconfig->setKeyDir(path_getfather(fn)); + theconfig->setKeyDir(fn.empty() ? "" : path_getfather(fn)); if (fn.empty() || !idoc.ipath.empty()) { TempFile temp = lthr.tmpimg; if (temp) { diff --git a/src/qtgui/rclm_view.cpp b/src/qtgui/rclm_view.cpp index f6187f8a..e256a74e 100644 --- a/src/qtgui/rclm_view.cpp +++ b/src/qtgui/rclm_view.cpp @@ -293,12 +293,12 @@ void RclMain::startNativeViewer(Rcl::Doc doc, int pagenum, QString term) bool enterHistory = false; bool istempfile = false; - LOGDEB(("RclMain::startNV: groksipath %d wantsf %d wantsparentf %d\n", - groksipath, wantsfile, wantsparentfile)); + LOGDEB(("RclMain::startNV: groksipath %d wantsf %d wantsparentf %d\n", + groksipath, wantsfile, wantsparentfile)); // If the command wants a file but this is not a file url, or // there is an ipath that it won't understand, we need a temp file: - theconfig->setKeyDir(path_getfather(fn)); + theconfig->setKeyDir(fn.empty() ? "" : path_getfather(fn)); if (!doc.isFsFile() || ((wantsfile || wantsparentfile) && fn.empty()) || (!groksipath && !doc.ipath.empty()) ) {