mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Avoid an unnecessary string copy
Spotted by Coverity scan.
This commit is contained in:
parent
a47d66df34
commit
851e59cd26
@ -245,14 +245,13 @@ LyXVC::CommandResult LyXVC::checkIn(string & log)
|
|||||||
LYXERR(Debug::LYXVC, "LyXVC: checkIn");
|
LYXERR(Debug::LYXVC, "LyXVC: checkIn");
|
||||||
if (!vcs_)
|
if (!vcs_)
|
||||||
return ErrorBefore;
|
return ErrorBefore;
|
||||||
docstring empty(_("(no log message)"));
|
|
||||||
docstring response;
|
docstring response;
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
if (vcs_->isCheckInWithConfirmation())
|
if (vcs_->isCheckInWithConfirmation())
|
||||||
ok = Alert::askForText(response, _("LyX VC: Log Message"));
|
ok = Alert::askForText(response, _("LyX VC: Log Message"));
|
||||||
if (ok) {
|
if (ok) {
|
||||||
if (response.empty())
|
if (response.empty())
|
||||||
response = empty;
|
response = _("(no log message)");
|
||||||
//shell collisions
|
//shell collisions
|
||||||
response = subst(response, from_ascii("\""), from_ascii("\\\""));
|
response = subst(response, from_ascii("\""), from_ascii("\\\""));
|
||||||
return vcs_->checkIn(to_utf8(response), log);
|
return vcs_->checkIn(to_utf8(response), log);
|
||||||
|
Loading…
Reference in New Issue
Block a user