another bibtex parsing fix

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3710 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2002-03-11 14:57:40 +00:00
parent 1045951369
commit cc96405d1b
2 changed files with 12 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2002-03-11 Herbert Voss <voss@lyx.org>
* biblio.C (parseBibTeX): fix another minibug with an
ending comma
2002-03-10 Herbert Voss <voss@lyx.org>
* biblio.C (parseBibTeX): fix bug

View File

@ -9,6 +9,7 @@
*
* \file biblio.C
* \author Angus Leeming <a.leeming@ic.ac.uk>
* \author Herbert Voss <voss@perce.de>
*/
#include <config.h>
@ -212,7 +213,7 @@ string const getYear(InfoMap const & map, string const & key)
if (year.empty())
year = "50BC";
return year;
}
@ -394,7 +395,8 @@ string const parseBibTeX(string data, string const & findkey)
if (data.length() < 2 || data[0] != '=') { // a valid entry?
return string();
} else {
data = frontStrip(data.substr(1, data.length() - 1));
// delete '=' and the following spaces
data = frontStrip(frontStrip(data,'='));
if (data.length() < 2) {
return data; // not long enough to find delimiters
} else {
@ -405,7 +407,9 @@ string const parseBibTeX(string data, string const & findkey)
} else if (data[0] == '"') {
enclosing = '"';
} else {
return data; // no {} and no "", pure data
// no {} and no "", pure data but with a
// possible ',' at the end
return strip(data,',');
}
string tmp = data.substr(keypos);
while (tmp.find('{') != string::npos &&