From 5d6b1ea2a174023ebf439cebb3ecc95ae1e40247 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Tue, 12 Apr 2016 18:13:10 +0200 Subject: [PATCH] Preview and Open for web cache: setKeyDir(getfather("")) resulted in ./ and getConfParam() failures --- src/qtgui/preview_w.cpp | 2 +- src/qtgui/rclm_view.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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()) ) {