preamble.cpp revert crash prone code

a real fix is on the list and will hopefully be comitted tomorrow.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_5_X@22043 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Uwe Stöhr 2007-12-09 16:45:04 +00:00
parent ee6400b2ad
commit 003c6aa0f8

View File

@ -120,19 +120,14 @@ void handle_opt(vector<string> & opts, char const * const * what, string & targe
if (opts.empty()) if (opts.empty())
return; return;
// the last language option is the document language (for babel and LyX)
// the last size option is the document font size
vector<string>::iterator it; vector<string>::iterator it;
vector<string>::iterator position = opts.begin();
for (; *what; ++what) { for (; *what; ++what) {
it = find(opts.begin(), opts.end(), *what); it = find(opts.begin(), opts.end(), *what);
if (it != opts.end()) { if (it != opts.end()) {
if (it >= position) { target = *what;
target = *what;
position = it;
}
// remove found options from the list // remove found options from the list
opts.erase(it); opts.erase(it);
return;
} }
} }
} }