mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
fix bug 2687
* 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
This commit is contained in:
parent
2ae2c0db71
commit
766709e999
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user