Juergen Spitzmueller wrote:
> 
>> I noticed that the (natbib) citation style choice doesn't use the name 
>> of the selected citation anymore (it's always "Caesar et al...").


attached a patch

Herbert



-- 
http://www.lyx.org/help/
Index: src/frontends/controllers/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ChangeLog,v
retrieving revision 1.144
diff -u -r1.144 ChangeLog
--- src/frontends/controllers/ChangeLog 2002/03/07 18:59:07     1.144
+++ src/frontends/controllers/ChangeLog 2002/03/10 17:02:48
@@ -1,3 +1,7 @@
+2002-03-10  Herbert Voss  <[EMAIL PROTECTED]>
+
+       * biblio.C: fix bug in parseBibtex
+
 2002-03-07  Lars Gullik Bjønnes  <[EMAIL PROTECTED]>
 
        * ControlSendto.C (allFormats): fix a iterators are not pointers
Index: src/frontends/controllers/biblio.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/biblio.C,v
retrieving revision 1.17
diff -u -r1.17 biblio.C
--- src/frontends/controllers/biblio.C  2002/03/05 17:48:21     1.17
+++ src/frontends/controllers/biblio.C  2002/03/10 17:02:48
@@ -212,10 +212,6 @@
 
 
 
-
-
-
-
 // A functor for use with std::sort, leading to case insensitive sorting
 struct compareNoCase: public std::binary_function<string, string, bool> 
 {
@@ -339,8 +335,8 @@
                string::size_type const idx =
                        dummy.empty() ? string::npos : dummy.find('%');
                if (idx != string::npos) {
+                       // ignore lines with a beginning '%'
                        if (idx > 0) {
-                               // This is safe. data MUST contain a '%'
                                data_ += dummy.substr(0,data.find('%'));
                        }
                } else {
@@ -379,12 +375,12 @@
                data = strip(data, '}');// maybe there is a main closing '}'
        // happens, when last keyword
        string::size_type const idx =
-               data.empty() ? data.find('=') : string::npos;
+               !data.empty() ? data.find('=') : string::npos;
 
        if (idx == string::npos)
                return string();
 
-       data = data.substr(idx, data.length() - 1);
+       data = data.substr(idx);
        data = frontStrip(strip(data));
 
        if (data.length() < 2 || data[0] != '=') {      // a valid entry?
@@ -403,16 +399,16 @@
                        } else {
                                return data;    // no {} and no "", pure data
                        }
-                       string tmp = data.substr(keypos, data.length()-1);
+                       string tmp = data.substr(keypos);
                        while (tmp.find('{') != string::npos &&
                               tmp.find('}') != string::npos &&
                               tmp.find('{') < tmp.find('}') &&
                               tmp.find('{') < tmp.find(enclosing)) {
                                
                                keypos += tmp.find('{') + 1;
-                               tmp = data.substr(keypos, data.length() - 1);
+                               tmp = data.substr(keypos);
                                keypos += tmp.find('}') + 1;
-                               tmp = data.substr(keypos, data.length() - 1);
+                               tmp = data.substr(keypos);
                        }
                        if (tmp.find(enclosing) == string::npos)
                                return data;

Reply via email to