[arachne] Fw: Arachne Bugs and Fixes

Arachne at FreeLists---The Arachne Fan Club!

Richard,

Thank you very much. :)

I don't have GGI installed on my machine so was unable to
try building and debugging the GGI version.

I have forwarded your message to our mailing list at freelists.

Perhaps others will find this information helpful as-well.

----- Forwarded message begin -----
From: Richard Zidlicky <rz@xxxxxxxxxxxxxx>

Hi,

hope I found at least one right address to submit bug reports and
fixes.

I have built and debugged the asrc193/arachne-ggi variant on Linux,
seems to be working fine although it needed a number of tweaks.

First a few observations:

- LICENSing looks confused. With all due respect to the past authors
  - either the whole thing is GPL or it is not. This should be
  stated somewhere very clearly and *all* obsolete docs should go
  into the history/ folder. Not many people will know enough about
  the history of the browser to understand the mess.

- it is unnecessary difficult to build and get started for a variety
  of reasons:
  + file/directory permissions are wrong
     chmod +x icq
     chmod +x js
     chmod +x ggi
  + no README or INSTALL
  + requires files that are only in the binary package
  + 2 different instal scripts are quite confusing. Maybe there should
    be install-root and install-user

- the code for guessing /usr/share/arachne is quite complicated example of
  shoot my own foot and fails to work in most situations. I have replaced
  it with a hardwired path, might be good to check for $ARACHNE_SHARE or
  something similar in addition to that.

- the browser segfaults very easilly if some config variables are not
  set. This is easy to miss unless you occassionally test with an empty
  configuration file.

Attached a patch, most places fix various segfaults, other deal with
compilation problems - apparently ggi wasn't tested for some time?

The posix.h patch was needed for some debugging and actually should
not go into stable releases.

Richard

diff -urN arachne-src-orig/cgiquery.c arachne-rz/cgiquery.c
--- arachne-src-orig/cgiquery.c 2008-05-24 03:53:25.000000000 +0200
+++ arachne-rz/cgiquery.c       2008-08-23 17:31:07.000000000 +0200
@@ -661,7 +661,7 @@
   if(cgi==0 && modified)
   {
    ptr=configvariable(&ARACHNEcfg,"SavePasswords",NULL);
-   if(*ptr && toupper(*ptr)=='N')
+   if(ptr && toupper(*ptr)=='N')
     strcpy(ARACHNEcfg.killstr,"sword ");
    else
     ARACHNEcfg.killstr[0]='\0';
diff -urN arachne-src-orig/config.c arachne-rz/config.c
--- arachne-src-orig/config.c   2008-05-24 03:53:25.000000000 +0200
+++ arachne-rz/config.c 2008-08-23 15:55:53.000000000 +0200
@@ -82,6 +82,9 @@
  else
   strcpy(helppath,exepath);

+
+
+
  str1= strrchr( helppath, '/');
  if(str1)
  {
@@ -95,6 +98,9 @@
  else
   strcat(helppath,"../");

+ // ignore complicated algorithm and use hardwired path
+ strcpy(helppath,"/usr/");
+
  strcpy(sharepath,helppath);
  strcat(helppath,"doc/arachne/html/");
  strcat(sharepath,"share/arachne/");
diff -urN arachne-src-orig/drawtime.c arachne-rz/drawtime.c
--- arachne-src-orig/drawtime.c 2008-05-24 03:53:25.000000000 +0200
+++ arachne-rz/drawtime.c       2008-08-22 21:33:11.000000000 +0200
@@ -1,3 +1,6 @@
+#ifdef POSIX
+#include <time.h>
+#endif

 #include "arachne.h"
 #include "alttab.h"
diff -urN arachne-src-orig/errors.c arachne-rz/errors.c
--- arachne-src-orig/errors.c   2008-05-24 06:48:46.000000000 +0200
+++ arachne-rz/errors.c 2008-08-22 22:09:07.000000000 +0200
@@ -13,8 +13,10 @@
 #ifdef VIRT_SCR
  deallocvirtual();
 #endif
+#ifndef POSIX
  x_fnt_cls();
 #endif
+#endif
  mouseoff();
  ie_destroy();
 }
diff -urN arachne-src-orig/ggi/makefile arachne-rz/ggi/makefile
--- arachne-src-orig/ggi/makefile       2008-06-08 01:32:11.000000000 +0200
+++ arachne-rz/ggi/makefile     2008-08-23 16:15:02.000000000 +0200
@@ -3,8 +3,8 @@
 CC=gcc
 STRIP=strip

-CFLAGS  = -march=i486 -O2 -fomit-frame-pointer -g -Wall
-CFLAGS += -D LINUX -D POSIX -D OVRL -D NOKEY -D HICOLOR -D GGI
+CFLAGS  = -O0 -g -Wall
+CFLAGS += -D LINUX -D POSIX -D CLEMTEST -D OVRL -D NOKEY -D HICOLOR -D GGI
 OFILES  = linmain.o linglue.o iekernel.o ie_fce.o ie_key.o str.o
 OFILES += ie_bin.o fexists.o config.o version.o errors.o outs.o html.o
 OFILES += htmlutil.o htmtable.o htmlread.o htmlstat.o atoms.o scrolbar.o
@@ -23,7 +23,7 @@
        $(CC) $(CFLAGS) -c -o $*.o $<

 arachne:       $(OFILES)
-       $(CC) -o arachne-ggi $(OFILES) $(LIBS)
+       $(CC) -g -o arachne-ggi $(OFILES) $(LIBS)
 #      $(STRIP) arachne

 clean:
diff -urN arachne-src-orig/globals.c arachne-rz/globals.c
--- arachne-src-orig/globals.c  2008-05-24 07:16:31.000000000 +0200
+++ arachne-rz/globals.c        2008-08-23 17:15:58.000000000 +0200
@@ -155,7 +155,7 @@
 int lastfoundX=0;

 #ifdef POSIX
-char *cachepath="cache/";
+char *cachepath="/home/rz/.arachne/cache/";
 #else
 char *cachepath="CACHE\\";
 #endif
diff -urN arachne-src-orig/guievent.c arachne-rz/guievent.c
--- arachne-src-orig/guievent.c 2008-05-24 05:25:22.000000000 +0200
+++ arachne-rz/guievent.c       2008-08-22 21:30:02.000000000 +0200
@@ -2115,8 +2115,8 @@
       mouseon();
       switch(scrollbarbutton)
       {
-       case 1: return smothup();
-       case 2: return smothdown();
+       case 1: return smothup(1);
+       case 2: return smothdown(1);
        case 3: return smothleft();
        case 4: return smothright();
       }//end switch
diff -urN arachne-src-orig/html.c arachne-rz/html.c
--- arachne-src-orig/html.c     2008-05-24 04:43:33.000000000 +0200
+++ arachne-rz/html.c   2008-08-23 22:52:34.000000000 +0200
@@ -1124,9 +1124,15 @@

      case TAG_IMG: //<IMG>
 //!!glennmcc: Dec 03, 2005 - optionally do not display any remote images
-   if(((!strncmpi(cache->URL,"http:",5) || !strncmpi(cache->URL,"ftp:",4)) &&
-       configvariable(&ARACHNEcfg,"IgnoreImages",NULL)[0]=='Y'))
-      break;
+   if(((!strncmpi(cache->URL,"http:",5) || !strncmpi(cache->URL,"ftp:",4))))
+     {
+       char *ii=configvariable(&ARACHNEcfg,"IgnoreImages",NULL);
+       if (ii && *ii=='Y')
+        break;
+     }
+// &&
+//       configvariable(&ARACHNEcfg,"IgnoreImages",NULL)[0]=='Y'))
+//    break;
 //!!glennmcc: end
      input_image=0;
      process_input_image:
@@ -1281,7 +1287,7 @@
 //defaults to max 2048 if variable missing from CFG
 //min setting 100
 maxwidth=configvariable(&ARACHNEcfg,"MaxImgWidth",NULL);
-if(atoi(maxwidth)<100) strcpy(maxwidth,"2048");
+if(!maxwidth || atoi(maxwidth)<100) maxwidth=strdup("2048");
 if(img->size_x>atoi(maxwidth))
    break;
 //!!glennmcc: end
@@ -3256,10 +3262,16 @@
       }

 //!!glennmcc: Feb 14, 2006 -- optionally ignore 'active'
-      if(getvar("CHECKED",&tagarg) || (getvar("ACTIVE",&tagarg) &&
-     configvariable(&ARACHNEcfg,"IgnoreActive",NULL)[0]!='Y'))
+      if(getvar("CHECKED",&tagarg) || (getvar("ACTIVE",&tagarg)))
+       {
+         char *ia=configvariable(&ARACHNEcfg,"IgnoreActive",NULL);
+         if (ia && *ia!='Y')
+           checked=1;
+       }
+// &&
+//     configvariable(&ARACHNEcfg,"IgnoreActive",NULL)[0]!='Y'))
 //    if(getvar("CHECKED",&tagarg) || getvar("ACTIVE",&tagarg))
-      checked=1;
+//      checked=1;
 //!!glennmcc: end

       if(getvar("NAME",&tagarg))
@@ -3754,10 +3766,16 @@
 //!!glennmcc: end

 //!!glennmcc: Feb 14, 2006 -- optionally ignore 'active'
-     if(getvar("ACTIVE",&tagarg) &&
-  configvariable(&ARACHNEcfg,"IgnoreActive",NULL)[0]!='Y')
+     if(getvar("ACTIVE",&tagarg))
+       {
+        char *ia=configvariable(&ARACHNEcfg,"IgnoreActive",NULL);
+        if (ia && *ia!='Y')
+          active=1;
+       }
+//     &&
+//  configvariable(&ARACHNEcfg,"IgnoreActive",NULL)[0]!='Y')
 //   if(getvar("ACTIVE",&tagarg))
-      active=1;
+//      active=1;
 //!!glennmcc: end

      if(rv==1)
diff -urN arachne-src-orig/htmlutil.c arachne-rz/htmlutil.c
--- arachne-src-orig/htmlutil.c 2008-05-24 03:53:25.000000000 +0200
+++ arachne-rz/htmlutil.c       2008-08-25 15:32:34.000000000 +0200
@@ -921,10 +921,12 @@
   addatom(&HTMLatom,str,strlen(str),HREF,BOTTOM,0,0,IE_NULL,1);
   currentlink=p->lastHTMLatom;

-  getvar("NAME",&tagarg);
-  strcat(str," (");
-  strcat(str,tagarg);
-  strcat(str,")");
+  if (getvar("NAME",&tagarg))
+    {
+      strcat(str," (");
+      strcat(str,tagarg);
+      strcat(str,")");
+    }

 //  pushfont(font,style,&HTMLatom,&fontstack);
   HTMLatom.R=p->tmpframedata[p->currentframe].linkR;
diff -urN arachne-src-orig/onmouse.c arachne-rz/onmouse.c
--- arachne-src-orig/onmouse.c  2008-05-24 05:30:46.000000000 +0200
+++ arachne-rz/onmouse.c        2008-08-23 17:25:50.000000000 +0200
@@ -21,7 +21,7 @@
  int dx,x,y;
  long dy;
  char ontoolbar=0;
- struct HTMLrecord *atomptr;
+ struct HTMLrecord *atomptr=NULL;
  int count=0;

  if(mousey<p->htscrn_ytop && !customerscreen)
@@ -757,7 +757,7 @@
 //imgflag enhancement by Ray
   {
    static int imgflag=0;
-   if(atomptr->type==IMG)
+   if(atomptr && atomptr->type==IMG)
    {
     struct picinfo *imgptr=(struct picinfo*)ie_getswap(atomptr->ptr);
     if(strncmpi(imgptr->alt,"IMAGE",5))

diff -urN arachne-src-orig/posix.h arachne-rz/posix.h
--- arachne-src-orig/posix.h    2000-08-29 01:07:24.000000000 +0200
+++ arachne-rz/posix.h  2008-08-23 16:14:26.000000000 +0200
@@ -25,8 +25,13 @@
 //==========================================================================

 //....  will include standard header files later ....
+
+
+
 #include <stdio.h>
+#define __inline
 #include <stdlib.h>
+#undef __inline
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/time.h>

------ Forwarded message end ------

                  Arachne at FreeLists                  
-- Arachne, The Premier GPL Web Browser/Suite for DOS --

Other related posts: