[w3m-dev 03528] area without alt

* map.c (getCurrentMapLabel): when a->alt is empty
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
This commit is contained in:
Fumitoshi UKAI
2002-12-05 16:08:34 +00:00
parent 543b6cffef
commit dd4e9f38d1
2 changed files with 20 additions and 10 deletions

View File

@@ -1,3 +1,8 @@
2002-12-06 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
* [w3m-dev 03528] area without alt
* map.c (getCurrentMapLabel): when a->alt is empty
2002-12-06 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> 2002-12-06 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
* [w3m-dev 03527] fix frame.c * [w3m-dev 03527] fix frame.c
@@ -5465,4 +5470,4 @@ a * [w3m-dev 03276] compile error on EWS4800
* release-0-2-1 * release-0-2-1
* import w3m-0.2.1 * import w3m-0.2.1
$Id: ChangeLog,v 1.591 2002/12/05 16:04:00 ukai Exp $ $Id: ChangeLog,v 1.592 2002/12/05 16:08:34 ukai Exp $

23
map.c
View File

@@ -1,4 +1,4 @@
/* $Id: map.c,v 1.18 2002/12/02 17:55:50 ukai Exp $ */ /* $Id: map.c,v 1.19 2002/12/05 16:08:34 ukai Exp $ */
/* /*
* client-side image maps * client-side image maps
*/ */
@@ -137,7 +137,7 @@ getCurrentMapLabel(Buffer *buf)
ListItem *al; ListItem *al;
MapArea *a; MapArea *a;
int i, n; int i, n;
Str s; Str s = NULL;
a_img = retrieveCurrentImg(buf); a_img = retrieveCurrentImg(buf);
if (!(a_img && a_img->image && a_img->image->map)) if (!(a_img && a_img->image && a_img->image->map))
@@ -159,11 +159,15 @@ getCurrentMapLabel(Buffer *buf)
a = (MapArea *) al->ptr; a = (MapArea *) al->ptr;
if (!(a && i == n)) if (!(a && i == n))
continue; continue;
s = Sprintf("[%s]", a->alt); if (*a->alt)
if (*a->alt) { s = Sprintf("[%s]", a->alt);
if (*a->url) {
ParsedURL pu; ParsedURL pu;
parseURL2(a->url, &pu, baseURL(buf)); parseURL2(a->url, &pu, baseURL(buf));
Strcat_char(s, ' '); if (s)
Strcat_char(s, ' ');
else
s = Strnew();
Strcat(s, parsedURL2Str(&pu)); Strcat(s, parsedURL2Str(&pu));
} }
return s; return s;
@@ -280,8 +284,9 @@ follow_map_panel(Buffer *buf, char *name)
continue; continue;
parseURL2(a->url, &pu, baseURL(buf)); parseURL2(a->url, &pu, baseURL(buf));
url = html_quote(parsedURL2Str(&pu)->ptr); url = html_quote(parsedURL2Str(&pu)->ptr);
Strcat_m_charp(mappage, "<tr><td>", html_quote(a->alt), Strcat_m_charp(mappage, "<tr><td><a href=\"", url, "\">",
"<td><a href=\"", url, "\">", url, "</a>\n", NULL); html_quote(*a->alt ? a->alt : mybasename(a->url)),
"</a><td>", url, NULL);
} }
Strcat_charp(mappage, "</table></body></html>"); Strcat_charp(mappage, "</table></body></html>");
@@ -409,8 +414,8 @@ append_map_info(Buffer *buf, Str tmp, FormItemList *fi)
parseURL2(a->url, &pu, baseURL(buf)); parseURL2(a->url, &pu, baseURL(buf));
url = html_quote(parsedURL2Str(&pu)->ptr); url = html_quote(parsedURL2Str(&pu)->ptr);
Strcat_m_charp(tmp, "<tr><td>&nbsp;&nbsp;<td><a href=\"", url, "\">", Strcat_m_charp(tmp, "<tr><td>&nbsp;&nbsp;<td><a href=\"", url, "\">",
html_quote(a->alt), "</a><td>", html_quote(a->url), html_quote(*a->alt ? a->alt : mybasename(a->url)),
"\n", NULL); "</a><td>", html_quote(a->url), "\n", NULL);
} }
Strcat_charp(tmp, "</table>"); Strcat_charp(tmp, "</table>");
} }