Tom Lane wrote:
[...] extraneous bug description removed.
> > Solaris' fgets function *only* returns the last part of a string if the
> > string is over 256 bytes! The test was this little program:
>
> > #include <stdio.h>
> > int main(int argc,char **argv) {
> > char line[1024];
> > while((fgets(line,1024,stdin)) != EOF) {
> > printf("Got '%s'\n",line);
> > }
> > }
>
> > Enter in really big lines (> 256 characters), and you'll see what I
> > mean.
>
> Yeesh. I wonder if any other Unixen are equally broken?
FWIW, I tested it on my Linux box (2.2.15-4mdk, a mandrake 7.2 distro),
and it worked fine. I can't speak to other unixes.
> Perhaps we should reduce psql's fgets() buffers to 256 bytes or less to
> avoid this problem?
Hrm...I don't know so much about that. That would limit it on boxes
where the fgets works as advertised.
Actually, how hard is it to add another test to the auto-configurtion
file? The little program above is small enough that it should be a
fairly simple deal to compile it during configuration, pipe input
through it, and see if fputs is limited. If it is, then the
configuration script could output a big warning message saying 'for your
own good, download and install readline, and then recompile'.
*shrug* At the very least, perhaps it could be put in the FAQ and/or
install docs?
-Ken