]> git.lyx.org Git - lyx.git/commitdiff
another bibtex parsing fix
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 11 Mar 2002 14:57:40 +0000 (14:57 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 11 Mar 2002 14:57:40 +0000 (14:57 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3710 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/controllers/ChangeLog
src/frontends/controllers/biblio.C

index 9a9f771e94a0a4c6f2b31f121b6a650a3ada800f..eacb46db7a68cfd47c48918469046ae4dc1bbabd 100644 (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
index 64cf3f487aa8c61ccea169bf30cc2df4038238b0..9082739e4fd81dc75ad1b6ad7f50b3c5238317b9 100644 (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 &&