mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-05 17:09:56 +00:00
Quote graphics conversion commands correctly.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_3_X@9821 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
30a6f0e4bf
commit
e9cd667d27
@ -1,3 +1,7 @@
|
|||||||
|
2005-04-17 Angus Leeming <leeming@lyx.org>
|
||||||
|
|
||||||
|
* GraphicsConverter.C (c-tor): quote conversion commands correctly.
|
||||||
|
|
||||||
2004-12-07 Angus Leeming <leeming@lyx.org>
|
2004-12-07 Angus Leeming <leeming@lyx.org>
|
||||||
|
|
||||||
* *.[Ch]: remove all traces of #pragma interface/implementation
|
* *.[Ch]: remove all traces of #pragma interface/implementation
|
||||||
|
@ -145,9 +145,12 @@ Converter::Impl::Impl(string const & from_file, string const & to_file_base,
|
|||||||
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
script_command_ =
|
script_command_ =
|
||||||
"sh " + LibFileSearch("scripts", "convertDefault.sh") +
|
"sh " +
|
||||||
' ' + from_format + ':' + from_file + ' ' +
|
QuoteName(LibFileSearch("scripts", "convertDefault.sh")) +
|
||||||
to_format + ':' + to_file_;
|
' ' +
|
||||||
|
QuoteName(from_format + ':' + from_file) +
|
||||||
|
' ' +
|
||||||
|
QuoteName(to_format + ':' + to_file_);
|
||||||
|
|
||||||
lyxerr[Debug::GRAPHICS]
|
lyxerr[Debug::GRAPHICS]
|
||||||
<< "\tNo converter defined! I use convertDefault.sh\n\t"
|
<< "\tNo converter defined! I use convertDefault.sh\n\t"
|
||||||
@ -181,8 +184,9 @@ Converter::Impl::Impl(string const & from_file, string const & to_file_base,
|
|||||||
// We create a dummy command for ease of understanding of the
|
// We create a dummy command for ease of understanding of the
|
||||||
// list of forked processes.
|
// list of forked processes.
|
||||||
// Note that 'sh ' is absolutely essential, or execvp will fail.
|
// Note that 'sh ' is absolutely essential, or execvp will fail.
|
||||||
script_command_ = "sh " + script_file_ + ' ' +
|
script_command_ = "sh " + QuoteName(script_file_) + ' ' +
|
||||||
OnlyFilename(from_file) + ' ' + to_format;
|
QuoteName(OnlyFilename(from_file)) + ' ' +
|
||||||
|
QuoteName(to_format);
|
||||||
}
|
}
|
||||||
// All is ready to go
|
// All is ready to go
|
||||||
valid_process_ = true;
|
valid_process_ = true;
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
2005-04-17 Angus Leeming <leeming@lyx.org>
|
||||||
|
|
||||||
|
* forkedcall.C (generateChild): do not strip quotes from args on
|
||||||
|
Windows.
|
||||||
|
Wrap lyxerr output inside an if (lyxerr.debugging(Debug::FILES))
|
||||||
|
block.
|
||||||
|
|
||||||
2005-02-17 Angus Leeming <leeming@lyx.org>
|
2005-02-17 Angus Leeming <leeming@lyx.org>
|
||||||
|
|
||||||
* copy.C (copy): Pass the ios::in flag to the ifstream constructor.
|
* copy.C (copy): Pass the ios::in flag to the ifstream constructor.
|
||||||
|
@ -283,11 +283,23 @@ int Forkedcall::generateChild()
|
|||||||
if (c == ' ')
|
if (c == ' ')
|
||||||
*it = '\0';
|
*it = '\0';
|
||||||
else if (c == '\'' || c == '"') {
|
else if (c == '\'' || c == '"') {
|
||||||
|
#if defined (_WIN32)
|
||||||
|
// How perverse!
|
||||||
|
// spawnvp *requires* the quotes or it will
|
||||||
|
// split the arg at the internal whitespace!
|
||||||
|
// Make shure the quote is a DOS-style one.
|
||||||
|
*it = '"';
|
||||||
|
#else
|
||||||
*it = '\0';
|
*it = '\0';
|
||||||
|
#endif
|
||||||
inside_quote = c;
|
inside_quote = c;
|
||||||
}
|
}
|
||||||
} else if (c == inside_quote) {
|
} else if (c == inside_quote) {
|
||||||
|
#if defined (_WIN32)
|
||||||
|
*it = '"';
|
||||||
|
#else
|
||||||
*it = '\0';
|
*it = '\0';
|
||||||
|
#endif
|
||||||
inside_quote = 0;
|
inside_quote = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -304,13 +316,16 @@ int Forkedcall::generateChild()
|
|||||||
argv.push_back(0);
|
argv.push_back(0);
|
||||||
|
|
||||||
// Debug output.
|
// Debug output.
|
||||||
vector<char *>::iterator ait = argv.begin();
|
if (lyxerr.debugging(Debug::FILES)) {
|
||||||
vector<char *>::iterator const aend = argv.end();
|
vector<char *>::iterator ait = argv.begin();
|
||||||
lyxerr << "<command>\n";
|
vector<char *>::iterator const aend = argv.end();
|
||||||
for (; ait != aend; ++ait)
|
lyxerr << "<command>\n\t" << line
|
||||||
if (*ait)
|
<< "\n\tInterpretted as:\n\n";
|
||||||
lyxerr << '\t'<< *ait << '\n';
|
for (; ait != aend; ++ait)
|
||||||
lyxerr << "</command>" << std::endl;
|
if (*ait)
|
||||||
|
lyxerr << '\t'<< *ait << '\n';
|
||||||
|
lyxerr << "</command>" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef __EMX__
|
#ifndef __EMX__
|
||||||
pid_t const cpid = ::fork();
|
pid_t const cpid = ::fork();
|
||||||
|
Loading…
Reference in New Issue
Block a user