|
From: Ethan M. <merritt@u.washington.edu> - 2009-11-02 16:57:38
|
On Monday 02 November 2009 08:06:04 Philipp K. Janert wrote:
>
> Comments at the end.
>
> On Sunday 01 November 2009 10:38:04 pm Ethan Merritt (sfeam) wrote:
> > On Sunday 01 November 2009, Philipp K. Janert wrote:
> > > > Simple test: feed it a file junk.dat:
> > > > 1
> > > > 2
> > > > junk
> > > > 3
> > > > 4
> > > >
> > > > gnuplot> plot 'junk.dat' with lp
> > > > ^
> > > > Bad data on line 3
> > > > gnuplot>
> > >
> > > Does plot do anything special here?
> > >
> > > I have a situation (stolen from the fit function),
> > > which basically says:
> > >
> > > while( (i = readline(...)) != EOF ) {
> > > ...
> > >
> > > And now I feed it your data file and it does NOT
> > > return either DF_MISSING or DF_UNDEFINED!
> >
> > No, it returns 0. But that's not EOF, so it should
> > be catchable.
>
> No, it doesn't. It does not return anything for the
> line that contains "junk", when run with "using 1".
>
> It does return -2 (DF_UNDEFINED) for the line
> with "junk", but only when run with "using ($1)".
Hence the entry on my TODO list that I quoted earlier.
You could evaluate the following simple-minded patch:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--- gnuplot/src/datafile.c 2009-10-10 11:43:30.000000000 -0700
+++ gnuplot-cvs/src/datafile.c 2009-11-02 08:53:58.000000000 -0800
@@ -1870,7 +1870,7 @@ df_readascii(double v[], int max)
/* line bad only if user explicitly asked
* for this column */
if (df_no_use_specs)
- line_okay = 0;
+ return DF_UNDEFINED;
break; /* return or ignore depending on line_okay */
}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
--
Ethan A Merritt
|