lynx-dev
[Top][All Lists]
Advanced

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

lynx-dev Re: 2.8.2pre.4


From: Leonid Pauzner
Subject: lynx-dev Re: 2.8.2pre.4
Date: Mon, 17 May 1999 15:27:56 +0400 (MSD)

> +1999-05-16 (2.8.2pre.4)
> +* add 'fixit' parameter to LYEnsureAbsoluteURL() to suppress logic in
> +  LYConvertToURL() that was changed in 2.8.1dev.4, to re-offer the original
> +  string after an invalid URL is entered at a 'g' prompt.  The calls to 
> support
> +  'g' are unmodified; other calls revert to the older behavior (recommended 
> by
> +  KW) -TD
> +* add/use string functions that make EBCDIC comparisons sort in the ASCII
> +  collating sequence, eliminating some special ifdef's in HTMLDTD.c -PG
> +* change UNKNOWN_URL_TYPE to 1, to keep it distinct from NOT_A_URL_TYPE, 
> fixes
> +  an error introduced when changing UrlTypes to an enum (reported by KW) -TD


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.

>  /*
>   *  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.

>  #endif
>       cp1++;
>       if (!*cp) {
> -         return(0);
> +         return(NOT_A_URL_TYPE);
>       } else if (isdigit((unsigned char)*cp1)) {
>           while (*cp1 && isdigit((unsigned char)*cp1))
>               cp1++;
> @@ -2550,7 +2550,7 @@
>       }
>      }

> -    return(0);
> +    return(NOT_A_URL_TYPE);
>  }


2. just minor cleanup:

>               diff < 0 ? (low = i+1) : (high = i)) {
>               /* Binary search */
>               i = (low + (high-low)/2);
> -             diff = strncmp(HTML_dtd.entity_names[i], name, len);
> +             diff = AS_ncmp(HTML_dtd.entity_names[i], name, len);
>               if (diff == 0) {
>                   HText_appendText(me->text,
>                                    LYCharSets[me->outUCLYhndl][i]);

> Index: WWW/Library/Implementation/HTString.h
> --- 2.8.2pre.3/WWW/Library/Implementation/HTString.h  Fri Apr 23 08:56:35 1999
> +++ 2.8.2pre.4/WWW/Library/Implementation/HTString.h  Sun May 16 21:11:26 1999
> @@ -16,6 +16,22 @@
>  extern CONST char * HTLibraryVersion;   /* String for help screen etc */

>  /*
> +    EBCDIC string comparison using ASCII collating sequence
----->          for binary search purposes.

> +*/
> +#ifdef    NOT_ASCII
> +extern int AS_casecomp  PARAMS((CONST char *a, CONST char *b));
> +extern int AS_ncmp PARAMS((CONST char *a, CONST char *b, unsigned int n));
> +#define    AS_cmp( a, b )  ( AS_ncmp( ( a ), ( b ), -1 ) )
   ^^^^^^^^^^^^^^^^^ this line probably not required since AS_cmp already
                     implemented and declared below.

> +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.

> +#define AS_cmp strcmp
> +
> +#endif /* NOT_ASCII */
> +
> +/*





reply via email to

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