While testing the patch I found a minor preexisting (mine...) bug: when
string-scanning doubles, whether the whole string is consumed or not is
not checked. This means that -D x=0one is interpreted as double 0.

I came up with the attached check, but maybe there is a cleaner way to do
that.

I like the way the zic code does it:

+               char xs;
!               if (sscanf(var->value, "%lf%c", &dv, &xs) != 1)

Indeed... I cannot say that it is cleaner such, but at least it is short and it avoids the strlen call.

Neither way allows for trailing whitespace, though.  I don't see that
that's important here.

No, this is not an issue here for variables specified from the command line. Consider pushing this fix?

--
Fabien.


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to