Bug repport, 2.15 library, modeule HTFile.c

In the module HTFile.c from the CERN WWW library, version 2.15, there are these  
lines.

 /*	Directory access is allowed and possible
 */
		logical = HTAnchor_address((HTAnchor*)anchor);
		tail = strrchr(logical, '/') +1;	/* last part or "" */

but when there is no '/' in the string, strrchr returns NILL, wich become  
0x0001.
This made my browser stop on the URL 'file:'.

I've replaced the line:
    'tail = strrchr(logical, '/') +1;	/* last part or "" */'
by (this is a quick hack):

	{ char *tempTail;
          if (tempTail = strrchr(logical, '/'))	
		    tail=tempTail+1;
           else
            tail=tail+strlen(tail);
        }

I've also seen that there are other similar uses of the 'strrchr' function.  
This may cause some other bugs.


Jean-Alexis

Received on Friday, 22 July 1994 12:14:59 UTC