X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmover.C;h=6fb9daf06c5cd988505ce81f0c0493d229c43068;hb=52eb91c94fb70d58dceef430659c8781de2eccda;hp=52c9d0064819656f46ed507296874de1a93b9f75;hpb=8e6e970d7ba017dba14bdb821f4c4489665d947c;p=lyx.git diff --git a/src/mover.C b/src/mover.C index 52c9d00648..6fb9daf06c 100644 --- a/src/mover.C +++ b/src/mover.C @@ -20,15 +20,12 @@ #include #include - -namespace lyx { - using std::ios; using std::string; -Movers movers; -Movers system_movers; +namespace lyx { +using support::quoteName; bool Mover::copy(support::FileName const & from, support::FileName const & to, unsigned long int mode) const @@ -74,9 +71,9 @@ bool SpecialisedMover::do_copy(support::FileName const & from, support::FileName } string command = support::libScriptSearch(command_); - command = support::subst(command, "$$i", from.toFilesystemEncoding()); - command = support::subst(command, "$$o", to.toFilesystemEncoding()); - command = support::subst(command, "$$l", latex); + command = support::subst(command, "$$i", quoteName(from.toFilesystemEncoding())); + command = support::subst(command, "$$o", quoteName(to.toFilesystemEncoding())); + command = support::subst(command, "$$l", quoteName(latex)); support::Systemcall one; return one.startscript(support::Systemcall::Wait, command) == 0; @@ -104,7 +101,9 @@ void Movers::set(string const & fmt, string const & command) Mover const & Movers::operator()(string const & fmt) const { SpecialsMap::const_iterator const it = specials_.find(fmt); - return (it == specials_.end()) ? default_ : it->second; + if (it == specials_.end()) + return default_; + return it->second; }