]> git.lyx.org Git - features.git/commitdiff
fix bug 2687
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Mon, 17 Jul 2006 20:06:58 +0000 (20:06 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Mon, 17 Jul 2006 20:06:58 +0000 (20:06 +0000)
* src/lyxfunc.C
(quoteArg): new, quotes arguments for the "log" dialog
(LyXFunc::dispatch): quote log filename

* src/frontends/controllers/ControlLog.C
(ControlLog::initialiseParams): parse \" as " and \\ as \ in filename

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14481 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/controllers/ControlLog.C
src/lyxfunc.C

index 148bd7f9b967c9087b18561625b6197bdb5ecb1f..2dd73a29302eb8d76bba912fe4071f5c255eaad0 100644 (file)
@@ -39,7 +39,11 @@ bool ControlLog::initialiseParams(string const & data)
        lex.setStream(is);
 
        string logtype, logfile;
-       lex >> logtype >> logfile;
+       lex >> logtype;
+       if (lex.isOK()) {
+               lex.next(true);
+               logfile = lex.getString();
+       }
        if (!lex)
                // Parsing of the data failed.
                return false;
index 1cff4e2847999abaccce85d0a86b3283d9e7240a..9f2a418c9ce0f1c265e261ad10f2d627faeab444 100644 (file)
@@ -199,6 +199,15 @@ Change::Type lookupChangeType(DocIterator const & dit, bool outer = false)
        return Change::UNCHANGED;
 }
 
+
+/// quotes a string for use as an argument of the "log" dialog
+string const quoteArg(string const & arg)
+{
+       ostringstream os;
+       os << '"' << subst(subst(arg, "\\", "\\\\"), "\"", "\\\"") << '"';
+       return os.str();
+}
+
 }
 
 LyXFunc::LyXFunc(LyXView * lv)
@@ -1175,11 +1184,11 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                                        data = "literate ";
                                        break;
                                }
-                               data += logfile.second;
+                               data += quoteArg(logfile.second);
                                owner->getDialogs().show("log", data);
                        } else if (name == "vclog") {
                                string const data = "vc " +
-                                       owner->buffer()->lyxvc().getLogFile();
+                                       quoteArg(owner->buffer()->lyxvc().getLogFile());
                                owner->getDialogs().show("log", data);
                        } else
                                owner->getDialogs().show(name, data);