projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
yaz-iconv: fix typos
[yaz-moved-to-github.git]
/
src
/
marc_read_line.c
diff --git
a/src/marc_read_line.c
b/src/marc_read_line.c
index
efbae74
..
7bfa198
100644
(file)
--- a/
src/marc_read_line.c
+++ b/
src/marc_read_line.c
@@
-1,5
+1,5
@@
/* This file is part of the YAZ toolkit.
/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2009 Index Data
+ * Copyright (C) Index Data
* See the file LICENSE for details.
*/
* See the file LICENSE for details.
*/
@@
-19,16
+19,15
@@
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <stdio.h>
#include <string.h>
-#include <ctype.h>
#include <yaz/marcdisp.h>
#include <yaz/wrbuf.h>
#include <yaz/yaz-util.h>
#include <yaz/marcdisp.h>
#include <yaz/wrbuf.h>
#include <yaz/yaz-util.h>
-int yaz_gets(int (*getbyte)(void *client_data),
- void (*ungetbyte)(int b, void *client_data),
- void *client_data,
- WRBUF w)
+static int yaz_gets(int (*getbyte)(void *client_data),
+ void (*ungetbyte)(int b, void *client_data),
+ void *client_data,
+ WRBUF w)
{
size_t sz = 0;
int ch = getbyte(client_data);
{
size_t sz = 0;
int ch = getbyte(client_data);
@@
-92,7
+91,7
@@
static int yaz_marc_line_gets(int (*getbyte)(void *client_data),
return 1;
}
return 1;
}
-
+
int yaz_marc_read_line(yaz_marc_t mt,
int (*getbyte)(void *client_data),
void (*ungetbyte)(int b, void *client_data),
int yaz_marc_read_line(yaz_marc_t mt,
int (*getbyte)(void *client_data),
void (*ungetbyte)(int b, void *client_data),
@@
-128,7
+127,7
@@
int yaz_marc_read_line(yaz_marc_t mt,
}
else if (line[0] == '(') /* annotation, skip it */
;
}
else if (line[0] == '(') /* annotation, skip it */
;
- else if (line_len == 24 && atoi_n_check(line, 5, &val) && val >= 24)
+ else if (line_len == 24 && atoi_n_check(line, 5, &val))
{
/* deal with header lines: 00366nam 22001698a 4500
*/
{
/* deal with header lines: 00366nam 22001698a 4500
*/
@@
-144,7
+143,7
@@
int yaz_marc_read_line(yaz_marc_t mt,
&length_implementation);
header_created = 1;
}
&length_implementation);
header_created = 1;
}
- else if (line_len > 5 && line[0] != ' ' && line[1] != ' '
+ else if (line_len > 4 && line[0] != ' ' && line[1] != ' '
&& line[2] != ' ' && line[3] == ' ' )
{
/* deal with data/control lines: 245 12 ........ */
&& line[2] != ' ' && line[3] == ' ' )
{
/* deal with data/control lines: 245 12 ........ */
@@
-196,14
+195,15
@@
int yaz_marc_read_line(yaz_marc_t mt,
{
const char *next;
size_t len;
{
const char *next;
size_t len;
-
+
assert(cp[0] == marker_ch);
cp++;
next = cp;
while ((next = strchr(next, marker_ch)))
{
if ((next[1] >= 'A' && next[1] <= 'Z')
assert(cp[0] == marker_ch);
cp++;
next = cp;
while ((next = strchr(next, marker_ch)))
{
if ((next[1] >= 'A' && next[1] <= 'Z')
- ||(next[1] >= 'a' && next[1] <= 'z'))
+ ||(next[1] >= 'a' && next[1] <= 'z')
+ ||(next[1] >= '0' && next[1] <= '9'))
{
if (!marker_skip)
break;
{
if (!marker_skip)
break;