Re: bug in www program and makefile

  Hi Fox One!

Fox One <rockman66_1999@yahoo.com> writes:

> There seems to be a bug in libwww's `www' program
> that prevents it from sending its output
> to the correct file when it is invoked with
> the `-o' option. For example, take this command:
> 
> www -w90 -na -p -to text/x-c HTAtom.html -o HTAtom.h
> 
> This command will only send the characters "/*" to
> the file HTAtom.h; the rest of the data will go
> to standard output. 
> 
> This causes problems for `libwww/Library/src/Makefile.am'
[...]

There are actually two problems:
1. In spite of the -o option, the output goes to stdout (only a
   comment start, /*, is placed in the output file).
2. When the browser encounters a TAB, it inserts a line break, thus
   breaking lots of #define directives.

It turned out that the LineMode browser always uses the LMHText_new()
function, which is used for interactive mode. It should use
LMHText_new2() which work in interactive as well as in non-interactive
mode (at least as far as is could see). This solves the first problem.

The second problem occurs due to missing tabstop information in the
default style. I simply copied the tabs_8[] from DefaultStyles.c to
GridText.c and linked it into the default style.

With these changes, the library can again be built with the help of a
previously installed LineMode browser. As far as I can tell, operation
in interactive mode is not affected.

  Regards,
    Stefan

Index: libwww/LineMode/src/HTBrowse.c
===================================================================
RCS file: /sources/public/libwww/LineMode/src/HTBrowse.c,v
retrieving revision 1.183
diff -r1.183 HTBrowse.c
1921c1921
<     if (!HText_registerCDCallback (LMHText_new, LMHText_delete)) {
---
>     if (!HText_registerCDCallback (LMHText_new2, LMHText_delete)) {

Index: libwww/LineMode/src/GridText.c
===================================================================
RCS file: /sources/public/libwww/LineMode/src/GridText.c,v
retrieving revision 1.50
diff -r1.50 GridText.c
104a105,112
> PRIVATE HTTabStop tabs_8[] = {
>       { 0, 8 }, {0, 16}, {0, 24}, {0, 32}, {0, 40},
>       { 0, 48 }, {0, 56}, {0, 64}, {0, 72}, {0, 80},
>       { 0, 88 }, {0, 96}, {0, 104}, {0, 112}, {0, 120},
>       { 0, 128 }, {0, 136}, {0, 144}, {0, 152}, {0, 160},
>       {0, 168}, {0, 176},
>       {0, 0 }         /* Terminate */
> };
119c127
<       0, 0, 0, HT_LEFT,               1, 0,   0, 
---
>       0, 0, 0, HT_LEFT,               1, 0,   tabs_8, 

Index: libwww/LineMode/src/GridText.html
===================================================================
RCS file: /sources/public/libwww/LineMode/src/GridText.html,v
retrieving revision 1.16
diff -r1.16 GridText.html
69a70,71
> extern HText* LMHText_new2 (HTRequest * req,
>               HTParentAnchor * anchor,HTStream * output_stream);


-- 
Veni, vidi, VISA: I came, I saw, I did a little shopping

Received on Saturday, 8 July 2000 11:17:07 UTC