Update of /cvsroot/refdb/refdb/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31753
Modified Files:
Tag: Release_0_9_5_stable
risdb.c
Log Message:
use two variables for primary and secondary year; ignore empty tag lines
Index: risdb.c
===================================================================
RCS file: /cvsroot/refdb/refdb/src/risdb.c,v
retrieving revision 1.44
retrieving revision 1.44.2.1
diff -u -U2 -r1.44 -r1.44.2.1
--- risdb.c 29 Apr 2004 22:41:57 -0000 1.44
+++ risdb.c 5 May 2004 19:42:07 -0000 1.44.2.1
@@ -266,5 +266,6 @@
int error = 0;
int nis_dummy = 0; /* will be 1 if dataset is a dummy */
- short int year; /* the year */
+ short int year = 0; /* the year */
+ short int year2 = 0; /* the secondary year */
dbi_driver driver;
dbi_result dbires;
@@ -605,4 +606,10 @@
token[token_len] = '\0';
+ /* ignore empty tag lines */
+ if (!token[6]) {
+ token = ris_strtok(token + token_len + 1, &token_len, "\n");
+ continue;
+ }
+
/* ------------------------------------------------------------ */
if (strncmp("RP - ", token, 6) == 0) {
@@ -798,16 +805,22 @@
/* ------------------------------------------------------------ */
else if (strncmp("PY - ", token, 6) == 0 || strncmp("Y1 - ", token, 6) == 0 || strncmp("Y2 - ", token, 6) == 0) {
+ /* use separate year variables for primary and secondary year */
if (strncmp("Y2 - ", token, 6) != 0) {
have_py++;
year_type = 0;
+
+ /* publication year */
+ year = risdate(otherinfo_buffer, &token[6]);
+
+ result = set_risdata_dateinfo(ptr_risdata, year_type, year, otherinfo_buffer, driver);
}
else {
year_type = 1;
- }
- /* publication year */
- year = risdate(otherinfo_buffer, &token[6]);
+ /* publication year */
+ year2 = risdate(otherinfo_buffer, &token[6]);
- result = set_risdata_dateinfo(ptr_risdata, year_type, year, otherinfo_buffer, driver);
+ result = set_risdata_dateinfo(ptr_risdata, year_type, year2, otherinfo_buffer, driver);
+ }
if (result == 1) {
|