lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lynx-dev Re: 2.8.2pre.4


From: dickey
Subject: Re: lynx-dev Re: 2.8.2pre.4
Date: Mon, 17 May 1999 11:25:43 -0400 (EDT)

> 1. when adding NOT_A_URL_TYPE we should inspect all is_url() calls - 
> one in LYEnsureAbsoluteURL() is now OK, 
> while the others in mainloop() and getfile() 
> should be checked both for UNKNOWN_URL_TYPE and NOT_A_URL_TYPE 
> since no 'guessing' assumed outside of LYEnsureAbsoluteURL(). 
> I will send a patch soon. 

yes (but as part of checking this, I looked at the definition before I made
the UrlType enum and saw that is_url() did not previously return a zero for
any of the known types, as KW said.  (If I had noticed that is_url returned
a zero, I would not have put UNKNOWN_URL_TYPE there -- but I did that
thinking - wrong - that it would simplify ifdef's).  So this patch undoes
that error only (other uses of is_url may have been introduced with
incorrect tests, but that's a different matter)

-- I added NOT_A_URL_TYPE so we don't "fix" this again, accidentally

> >  /* 
> >   *  For is_url(). 
> >   * 
> > - *  Universal document id types. 
> > + *  Universal document id types (see LYCheckForProxyURL) 
> >   */ 
> >  typedef enum { 
> > -    UNKNOWN_URL_TYPE = 0, 
> > +    NOT_A_URL_TYPE = 0, 
> > +    UNKNOWN_URL_TYPE = 1,    /* must be nonzero */ 
>  
> >      HTTP_URL_TYPE, 
> >      FILE_URL_TYPE, 


> > Index: src/LYUtils.c 
> > --- 2.8.2pre.3/src/LYUtils.c  Sat May  8 11:46:28 1999 
> > +++ 2.8.2pre.4/src/LYUtils.c  Sun May 16 21:11:26 1999 
> > @@ -2514,7 +2514,7 @@ 
> >       *       Don't crash on an empty argument. 
> >       */ 
> >      if (cp == NULL || *cp == '\0') 
> > -     return(0); 
> > +     return(NOT_A_URL_TYPE); 
>  
> >      /* kill beginning spaces */ 
> >      cp = LYSkipBlanks(cp); 
> > @@ -2535,11 +2535,11 @@ 
> >       FREE(cp2); 
> >  #if defined (DOSPATH) 
> >       if (cp[1] == ':') 
> > -         return(0);          /* could be drive letter? - kw */ 
> > +         return(NOT_A_URL_TYPE);     /* could be drive letter? - kw */ 
>                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
> Hmm, LYFillLocalFile() cares of it now, so this check probably not required. 

maybe (but I was keeping the change simple)
  
> > +extern int AS_cmp PARAMS((CONST char *a, CONST char *b)); 
> > + 
> > +#else 
> > +#define AS_casecomp( a, b ) ( strcasecomp( ( a ), ( b ) ) ) 
> > +#define AS_ncmp( a, b, c )  ( strncmp( ( a ), ( b ), ( c ) ) ) 
>  
> seems can be done without an extra brackets as below. 

probably (it did occur to me)
- but I left the patch as submitted since it was correct anyway,
  and is good practice in macros.
  

-- 
Thomas E. Dickey
address@hidden
http://www.clark.net/pub/dickey

reply via email to

[Prev in Thread] Current Thread [Next in Thread]