lynx-dev
[Top][All Lists]
Advanced

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

LYNX-DEV USEMAP problems (was Re: fotemods.zip update)


From: Klaus Weide
Subject: LYNX-DEV USEMAP problems (was Re: fotemods.zip update)
Date: Sat, 12 Apr 1997 21:50:47 -0500 (CDT)

On Sat, 12 Apr 1997, Foteos Macrides wrote:
> Klaus Weide <address@hidden> wrote:
> >On Sat, 12 Apr 1997, Foteos Macrides wrote:
> >> 1997-04-12
> >> *  Fixed a typo under case HTML_IMG: of HTML_start_element() in
> >>    HTML.c with the serious consequence that it can cause memory
> >>    corruption if a BASE element is present in markup with an IMG
> >>    or OBJECT element that has a USEMAP attribute.  This fix is
> >>    needed in all versions of Lynx since v2.6. - FM
> >
> [...]
>       if (map_href && strchr(map_href, '#')) {
> 
>           /*
>            *  Check whether a base tag is in effect. - FM
>            */
>           if ((me->inBASE && *map_href == '#') &&
>                                        ^^
>               (temp = HTParse(map_href, me->base_href, PARSE_ALL)) &&
>               *temp != '\0')
> [...]
> 
>       The "==" indicated by the cartas is "!=" in v2.7 and v2.7.1,
> and I presume all the devel code sets as well.
> 
>       Such a horrible consequence of such a small typo, sigh...

I believe this wasn't a typo at all, but is completely consistent with all
the other places where you try to accomodate the Fielding URL draft...
(which says that URL references without an URL, i.e. only a fragment,
refer to the current doc and should not cause a new retrieval action.)
Of course you are the final authority over whether you made a typo :) :)
but the code looks right to me with the "!=" and wrong after your
"correction"...

Below is a patch against 2.7.1.  The second difference section is the right
solution IMHO.  The other two are about other problems I found when I tried
to track down the problem.  

Of course I may be totally wrong.  I've also been looking at this stuff
way too long..

Well maybe I should describe what the problem(s) was (were).  To
reproduce, go to <URL: http://sol.slcc.edu/index2.html>.  Make a copy
to a local file _via the print menu_ (so that a BASE tag gets
inserted).  Quit Lynx, start Lynx again on that file.  follow one of
the LYNXIMGMAP: links.  On the map page, note where those links point
to (I think they point to the wrong places..).  
Don't follow any of them, but go back with the PREV_DOC (left arrow)
key.  The initial document now shows up as empty.

   Klaus


*** /usr/ns-home/docs/lynx/fote/lynx2-7-1/src/HTML.c    Thu Apr  3 06:42:45 1997
--- lynx2-7-1/src/HTML.c        Sat Apr 12 19:55:57 1997
***************
*** 467,473 ****
      char *cp = NULL;
  
      if (LYMapsOnly) {
!         if (!(element_number == HTML_MAP || element_number == HTML_AREA)) {
            return;
        }
      }
--- 467,474 ----
      char *cp = NULL;
  
      if (LYMapsOnly) {
!         if (!(element_number == HTML_MAP || element_number == HTML_AREA ||
!           element_number == HTML_BASE)) {
            return;
        }
      }
***************
*** 2636,2646 ****
--- 2637,2652 ----
         *  Load map_address. - FM
         */
        if (id_string) {
+ #ifdef NOTDEFINED
+           /* Nope.  We don't do this for other ID strings either... - kw */
            if (me->inBASE && me->base_href && *me->base_href) {
                StrAllocCopy(me->map_address, me->base_href);
            } else {
+ #endif /* NOTDEFINED */
                StrAllocCopy(me->map_address, me->node_anchor->address);
+ #ifdef NOTDEFINED
            }
+ #endif
            if ((cp = strrchr(me->map_address, '#')) != NULL)
                *cp = '\0';
            StrAllocCat(me->map_address, "#");
***************
*** 5366,5372 ****
  */
  PUBLIC void HTML_free ARGS1(HTStructured *, me)
  {
!     UPDATE_STYLE;             /* Creates empty document here! */
      if (me->comment_end)
        HTML_put_string(me, me->comment_end);
      if (me->text) {
--- 5372,5379 ----
  */
  PUBLIC void HTML_free ARGS1(HTStructured *, me)
  {
!     if (!LYMapsOnly || me->text)
!       UPDATE_STYLE;           /* Creates empty document here! */
      if (me->comment_end)
        HTML_put_string(me, me->comment_end);
      if (me->text) {

;
; To UNSUBSCRIBE:  Send a mail message to address@hidden
;                  with "unsubscribe lynx-dev" (without the
;                  quotation marks) on a line by itself.
;

reply via email to

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