lynx-dev
[Top][All Lists]
Advanced

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

Re: lynx-dev Parameter is Incorrect


From: Thomas Dickey
Subject: Re: lynx-dev Parameter is Incorrect
Date: Sun, 15 Sep 2002 20:51:22 -0400
User-agent: Mutt/1.3.27i

On Sun, Sep 15, 2002 at 06:40:23PM -0400, Thomas Dickey wrote:
> On Sun, Sep 15, 2002 at 05:51:12PM -0400, Leslie Fairall wrote:
> > Hello:
> > 
> > I am using the current developmental version of lynx (lynx 2.8.4dev8).
> > 
> > When one goes to <http://www.realtor.com> and goes to link 29 (rental
> > homes), the following message appears:
> > 
> > Alert!: HTTP/1/1 400 Bad Request
> > 
> > The parameter is correct.
> > 
> > If you type in the link directly,
> > <http://www.realtor.com/basics/rentals/default.asp> the page can be
> > accessed. When I used lynx 2.8.2rel1 I could access the link through
> > www.realtor.com. The lynx.trace file follows:
> 
> ...
> > HTAASetup_lookup: No template matched `basics/rentals/default.asp       
> > ?lnksrc=REALR2LF2C0062' (so probably not protected)
>  
> > What is broken here? Thanks.
> 
> The href (which is quoted) contains several tab characters.  My change
> to accommodate some pages which refer to filenames with embedded spaces
> is probably at fault.

Here's an attempt at retaining my change, but addressing this case:

--- LYCharUtils.c.orig  Sat Sep 14 11:22:55 2002
+++ LYCharUtils.c       Sun Sep 15 20:00:57 2002
@@ -2988,8 +2988,10 @@
         * No blanks really belong in the HREF, but if it refers to an actual
         * file, it may actually have blanks in the name.  Try to accommodate.
         */
-       LYRemoveNewlines(*href);
-       convert_to_spaces(*href, FALSE);
+       if (LYRemoveNewlines(*href) || strchr(*href, '\t') != 0)
+           LYRemoveBlanks(*href);
+       else
+           convert_to_spaces(*href, FALSE);
        LYTrimLeading(*href);
        LYTrimTrailing(*href);
        if (fragment != NULL) {
--- LYStrings.c.orig    Sat Sep 14 12:49:38 2002
+++ LYStrings.c Sun Sep 15 19:44:49 2002
@@ -2462,9 +2462,9 @@
 }
 
 /*
- * Remove newlines from a string.
+ * Remove newlines from a string, returning true if we removed any.
  */
-PUBLIC void LYRemoveNewlines ARGS1(
+PUBLIC BOOLEAN LYRemoveNewlines ARGS1(
        char *,         buffer)
 {
     if (buffer != 0) {
@@ -2473,7 +2473,9 @@
            if (buffer[i] != '\n' && buffer[i] != '\r')
                buffer[j++] = buffer[i];
        buffer[j] = 0;
+       return (i != j);
     }
+    return FALSE;
 }
 
 /*
--- LYStrings.h.orig    Wed Aug 14 18:38:51 2002
+++ LYStrings.h Sun Sep 15 19:44:44 2002
@@ -304,7 +304,7 @@
        char *          buffer));
 extern void LYUpperCase PARAMS((
        char *          buffer));
-extern void LYRemoveNewlines PARAMS((
+extern BOOLEAN LYRemoveNewlines PARAMS((
        char *          buffer));
 extern void LYRemoveBlanks PARAMS((
        char *          buffer));

-- 
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net

; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden

reply via email to

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