mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-05 13:26:21 +00:00
fix crash reported by Kayvan + ws
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7311 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
389bc3fc89
commit
8d2394b02c
@ -1,3 +1,8 @@
|
||||
2003-07-18 Alfredo Braunstein <abraunst@libero.it>
|
||||
|
||||
* lyx_main.C: fix a crash in batch mode if no files specified
|
||||
* converter.C: ws
|
||||
|
||||
2003-07-17 Alfredo Braunstein <abraunst@libero.it>
|
||||
|
||||
* format.[Ch] (papersize): moved to BufferParams
|
||||
|
@ -602,7 +602,7 @@ Converters::getReachableTo(string const & target, bool clear_visited)
|
||||
|
||||
vector<Format const *> const
|
||||
Converters::getReachable(string const & from, bool only_viewable,
|
||||
bool clear_visited)
|
||||
bool clear_visited)
|
||||
{
|
||||
vector<int> const & reachables =
|
||||
G_.getReachable(formats.getNumber(from),
|
||||
|
@ -142,6 +142,7 @@ LyX::LyX(int & argc, char * argv[])
|
||||
|
||||
// Execute batch commands if available
|
||||
if (!batch_command.empty()) {
|
||||
|
||||
lyxerr[Debug::INIT] << "About to handle -x '"
|
||||
<< batch_command << '\'' << endl;
|
||||
|
||||
@ -155,25 +156,28 @@ LyX::LyX(int & argc, char * argv[])
|
||||
// the filename if necessary
|
||||
string s = FileSearch(string(), *it, "lyx");
|
||||
if (s.empty()) {
|
||||
s = *it;
|
||||
last_loaded = newFile(*it, "");
|
||||
} else {
|
||||
last_loaded = bufferlist.newBuffer(s, false);
|
||||
last_loaded->error.connect(boost::bind(&LyX::printError, this, _1));
|
||||
if (!loadLyXFile(last_loaded, s)) {
|
||||
bufferlist.release(last_loaded);
|
||||
last_loaded = newFile(*it, string());
|
||||
}
|
||||
}
|
||||
|
||||
last_loaded = bufferlist.newBuffer(s, false);
|
||||
last_loaded->error.connect(boost::bind(&LyX::printError, this, _1));
|
||||
loadLyXFile(last_loaded, s);
|
||||
}
|
||||
|
||||
files.clear();
|
||||
|
||||
bool success = false;
|
||||
|
||||
// try to dispatch to last loaded buffer first
|
||||
bool const dispatched = last_loaded->dispatch(batch_command, &success);
|
||||
if (last_loaded)
|
||||
last_loaded->dispatch(batch_command, &success);
|
||||
else
|
||||
lyxerr << _("Batch command specified but no "
|
||||
"file loaded. Exiting.") << endl;
|
||||
|
||||
if (dispatched) {
|
||||
QuitLyX();
|
||||
exit(!success);
|
||||
}
|
||||
QuitLyX();
|
||||
exit(!success);
|
||||
}
|
||||
|
||||
lyx_gui::start(batch_command, files);
|
||||
|
Loading…
Reference in New Issue
Block a user