lynx-dev
[Top][All Lists]
Advanced

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

Re: [Lynx-dev] Bug in LYPrintImgMaps


From: Thomas Dickey
Subject: Re: [Lynx-dev] Bug in LYPrintImgMaps
Date: Tue, 25 Jul 2006 20:33:09 -0400
User-agent: Mutt/1.5.11+cvs20060403

On Sun, Jul 23, 2006 at 11:03:18AM -0700, Doug Kaufman wrote:
> On Sun, 23 Jul 2006, Thomas Dickey wrote:
> 
> > On Sun, 23 Jul 2006, Doug Kaufman wrote:
> > 
> > > There appears to be a bug in LYPrintImgMaps, introduced into LYMap.c
> > > with 2.8.6dev.16. This is used to print the content of USEMAP links when
> > > doing a dump, such as at the end of a PRINT command. It is printing the
> > > contents of USEMAPs not just for the current document, but also for
> > > previously visited documents.
> > > ...
> > 
> > I don't see this happening with my configuraton on Linux.  Perhaps it's a 
> > difference in configuration, or the method.  Visiting the first URL, I 
> > simply did a 'g' and pasted the second URL before printing the second 
> > page.
> 
> That is exactly what I did, but I got the USEMAP from the first URL
> when I printed the second one. I saw the same behavior with both DJGPP
> and MingW binaries of dev.16, dev.17, and dev.18. I have now tried
> this with multiple changes in configuration and can't find a setting
> that doesn't show this, aside from turning off "links are numbered". I
> also see the inappropriate USEMAP printed if I activate a link from my
> bookmark page then go (using "g") to a URL that has the USEMAP, then
> go back (using "h" with VI keys on), then print.
> 
> I also tried adding the link to my bookmark file and activating it from
> there. I see the same behavior, even if not using "g".

I'm not sure why the link-numbering would expose this, but see that when
I wrote LYPrintImgMaps(), I did not consider the possibility that the
USEMAP's would be still accessible when visiting a new page.  Here's a fix.

--- LYMap.c.orig        2005-12-18 18:07:04.000000000 -0500
+++ LYMap.c     2006-07-25 20:29:50.000000000 -0400
@@ -610,6 +610,8 @@
 
 void LYPrintImgMaps(FILE *fp)
 {
+    const char *only = HTLoadedDocumentURL();
+    int only_len = strlen(only);
     HTList *outer = LynxMaps;
     HTList *inner;
     LYImageMap *map;
@@ -618,6 +620,13 @@
 
     if (HTList_count(outer) > 0) {
        while (NULL != (map = (LYImageMap *) HTList_nextObject(outer))) {
+           if (only_len != 0) {
+               if (strncmp(only, map->address, only_len)
+                   || (map->address[only_len] != '\0'
+                       && map->address[only_len] != '#')) {
+                   continue;
+               }
+           }
            fprintf(fp, "\n%s\n", isEmpty(map->title) ? NO_MAP_TITLE : 
map->title);
            fprintf(fp, "%s\n", map->address);
            inner = map->elements;

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




reply via email to

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