Subject: pkg/18460: HTMLDOC 1.8.22 has been released (plus patch)
To: None <gnats-bugs@gnats.netbsd.org>
From: None <christianbiere@gmx.de>
List: netbsd-bugs
Date: 09/28/2002 21:49:56
>Number:         18460
>Category:       pkg
>Synopsis:       HTMLDOC 1.8.22 has been released (plus patch)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Sep 28 21:50:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Christian Biere
>Release:        1.6
>Organization:
>Environment:
NetBSD localhost 1.6 NetBSD 1.6 (DURON) #3: Sun Sep 15 07:51:30 CEST 2002     root@localhost:/usr/src-1-6/sys/arch/i386/compile/DURON i386
>Description:
It's a vanilla update. I've just replaced the version in Makefile.common and edited the distinfo file.

/usr/pkgsrc/www/htmldoc/distinfo:

SHA1 (htmldoc-1.8.22-source.tar.bz2) = 73493e3d921ab8419593b7a85d342d7f08e5ae38
Size (htmldoc-1.8.22-source.tar.bz2) = 2335516 bytes

However I have a patch for a little problem. HTMLDOC crashes if the
target file cannot be created e.g. "Permission denied.".
>How-To-Repeat:
$ htmldoc -f /tmp/bla/ --webpage http://netbsd.org/
ERR012: Unable to create output file "/tmp/bla/" - Not a directory.
ERR012: Unable to create output file "/tmp/bla/" - Not a directory.
Segmentation fault

>Fix:
--- htmldoc/html.cxx    2002/06/13 18:44:09     1.1
+++ htmldoc/html.cxx    2002/09/29 03:54:41
@@ -154,6 +154,8 @@
   {
     write_header(&out, (uchar *)"index.html", title, author, copyright,
                  docnumber, NULL);
+    if (out == NULL)
+      return -1;
     write_title(out, title, author, copyright, docnumber);
 
     write_footer(&out, NULL);
@@ -164,6 +166,9 @@
     write_header(&out, (uchar *)"index.html", title, author, copyright,
                  docnumber, NULL);
 
+  if (out == NULL)
+    return -1;
+
   write_all(out, toc, 0);
   write_footer(&out, NULL);
 
@@ -175,12 +180,17 @@
   {
     write_header(&out, htmlGetVariable(document, (uchar *)"FILENAME"),
                  title, author, copyright, docnumber, document);
+    if (out == NULL)
+      return -1;
     write_all(out, document->child, 0);
     write_footer(&out, document);
 
     document = document->next;
   }
 
+  if (out == NULL)
+    return -1;
+
   if (!OutputFiles && out != stdout)
   {
     fputs("</BODY>\n", out);

>Release-Note:
>Audit-Trail:
>Unformatted: