- if (sscanf(line, ZINT_FORMAT " " ZINT_FORMAT " " ZINT_FORMAT " %39s %n",
- &recWord.record_id, &recWord.section_id, &recWord.seqno,
- field, &nor) < 4)
- {
- yaz_log(YLOG_WARN, "Bad safari record line: %s", line);
- return RECCTRL_EXTRACT_ERROR_GENERIC;
- }
+ if (tinfo->segments)
+ {
+ if (sscanf(line, ZINT_FORMAT " " ZINT_FORMAT " " ZINT_FORMAT
+ ZINT_FORMAT " %39s %n",
+ &recWord.record_id, &recWord.section_id,
+ &recWord.segment,
+ &recWord.seqno,
+ field, &nor) < 5)
+ {
+ yaz_log(YLOG_WARN, "Bad safari record line: %s", line);
+ return RECCTRL_EXTRACT_ERROR_GENERIC;
+ }
+ }
+ else
+ {
+ if (sscanf(line, ZINT_FORMAT " " ZINT_FORMAT " " ZINT_FORMAT " %39s %n",
+ &recWord.record_id, &recWord.section_id, &recWord.seqno,
+ field, &nor) < 4)
+ {
+ yaz_log(YLOG_WARN, "Bad safari record line: %s", line);
+ return RECCTRL_EXTRACT_ERROR_GENERIC;
+ }
+ }