diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2013-10-02 23:30:51 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2013-10-02 23:30:51 -0400 |
commit | 851f7f168a6385cefbb858397195163aff5ed30b (patch) | |
tree | 92064337a675fd3ad6973e4bd55fba96b3765de3 /WWW | |
parent | 9a5dad0b622112211c1385c84b4937baf3cf7cb0 (diff) | |
download | lynx-snapshots-851f7f168a6385cefbb858397195163aff5ed30b.tar.gz |
snapshot of project "lynx", label v2-8-8dev_16i
Diffstat (limited to 'WWW')
-rw-r--r-- | WWW/Library/Implementation/HTAnchor.c | 18 | ||||
-rw-r--r-- | WWW/Library/Implementation/HTAnchor.h | 4 |
2 files changed, 20 insertions, 2 deletions
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); |