From 851f7f168a6385cefbb858397195163aff5ed30b Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Wed, 2 Oct 2013 23:30:51 -0400 Subject: snapshot of project "lynx", label v2-8-8dev_16i --- WWW/Library/Implementation/HTAnchor.c | 18 +++++++++++++++++- WWW/Library/Implementation/HTAnchor.h | 4 +++- 2 files changed, 20 insertions(+), 2 deletions(-) (limited to 'WWW') diff --git a/WWW/Library/Implementation/HTAnchor.c b/WWW/Library/Implementation/HTAnchor.c index 441a55e5..1b160691 100644 --- a/WWW/Library/Implementation/HTAnchor.c +++ b/WWW/Library/Implementation/HTAnchor.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTAnchor.c,v 1.74 2013/05/05 19:25:16 tom Exp $ + * $LynxId: HTAnchor.c,v 1.75 2013/10/02 23:24:34 tom Exp $ * * Hypertext "Anchor" Object HTAnchor.c * ========================== @@ -883,6 +883,22 @@ char *HTAnchor_address(HTAnchor * me) return (addr); } +char *HTAnchor_short_address(HTAnchor * me) +{ + const char chop[] = "file://localhost/"; + char *addr = HTAnchor_address(me); + + if (!strncmp(addr, chop, sizeof(chop) - 1)) { + char *a = addr + 7; + char *b = addr + sizeof(chop) - 2; + + while ((*a++ = *b++) != '\0') { + ; + } + } + return addr; +} + void HTAnchor_setFormat(HTParentAnchor *me, HTFormat form) { diff --git a/WWW/Library/Implementation/HTAnchor.h b/WWW/Library/Implementation/HTAnchor.h index 021a930d..c804aff5 100644 --- a/WWW/Library/Implementation/HTAnchor.h +++ b/WWW/Library/Implementation/HTAnchor.h @@ -1,5 +1,5 @@ /* - * $LynxId: HTAnchor.h,v 1.36 2012/08/15 10:48:24 tom Exp $ + * $LynxId: HTAnchor.h,v 1.37 2013/10/02 23:21:55 tom Exp $ * * Hypertext "Anchor" Object HTAnchor.h * ========================== @@ -224,6 +224,8 @@ extern "C" { */ extern char *HTAnchor_address(HTAnchor * me); + extern char *HTAnchor_short_address(HTAnchor * me); + extern void HTAnchor_setFormat(HTParentAnchor *me, HTFormat form); -- cgit 1.4.1-2-gfad0