@@ -277,7 +277,7 @@ XDI_readfile(char *filename, XDIFile *xdifile) {
277
277
return ERR_META_FORMAT ;
278
278
}
279
279
} else {
280
- if (ignored_headerline < 0 ) {
280
+ if (( ignored_headerline < 0 ) && ( has_minusline == 0 ) ) {
281
281
ignored_headerline = i ;
282
282
}
283
283
}
@@ -353,6 +353,9 @@ XDI_readfile(char *filename, XDIFile *xdifile) {
353
353
for (i = nheader - 2 ; i < ilen ; i ++ ) {
354
354
/* may find a header line interspersed in array data */
355
355
COPY_STRING (line , textlines [i ]);
356
+ xdifile -> error_lineno = i ;
357
+ COPY_STRING (xdifile -> error_line , line );
358
+
356
359
if (strncmp (textlines [i ], TOK_COMM , 1 ) == 0 ) {
357
360
line ++ ;
358
361
nwords = split_on (line , TOK_DELIM , words );
@@ -378,6 +381,10 @@ XDI_readfile(char *filename, XDIFile *xdifile) {
378
381
++ ipt ;
379
382
}
380
383
}
384
+ /* success */
385
+ xdifile -> error_lineno = 0 ;
386
+ COPY_STRING (xdifile -> error_line , "" );
387
+
381
388
xdifile -> npts = ipt ;
382
389
xdifile -> nouter = iouter ;
383
390
xdifile -> narrays = ncols ;
@@ -389,6 +396,7 @@ XDI_readfile(char *filename, XDIFile *xdifile) {
389
396
xdifile -> outer_array [j ] = outer_arr [j ];
390
397
xdifile -> outer_breakpts [j ] = outer_pts [j ];
391
398
}
399
+
392
400
return iret ;
393
401
394
402
}
0 commit comments