From 9c4461deea8eabb5bc025a08fa6ce11cb1c9e6fd Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Mon, 2 Dec 2013 21:04:46 +0100 Subject: [PATCH] Return an error if file-open is called with a non-absolute path --- src/frontends/qt4/GuiApplication.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index 72ed714408..6d70345856 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -1572,8 +1572,12 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr) validateCurrentView(); // FIXME: create a new method shared with LFUN_HELP_OPEN. string const fname = to_utf8(cmd.argument()); - bool const is_open = FileName::isAbsolute(fname) - && theBufferList().getBuffer(FileName(fname)); + if (!FileName::isAbsolute(fname)) { + dr.setError(true); + dr.setMessage(_("Absolute filename expected.")); + break; + } + bool const is_open = theBufferList().getBuffer(FileName(fname)); if (d->views_.empty() || (!lyxrc.open_buffers_in_tabs && current_view_->documentBufferView() != 0 -- 2.39.2