diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2015-07-28 21:25:57 +0200 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2015-07-28 21:25:57 +0200 |
commit | b5c3d48091fb2856d768223deb42d3674edcc7b2 (patch) | |
tree | ecbd6a1a495624395e88edaf4328f6cbfc3c9b89 /sfeed_web.c | |
parent | ce1c1697a4d3a0e592b47ae65b4096d21d4cb90b (diff) |
use new uri parser
Diffstat (limited to 'sfeed_web.c')
-rw-r--r-- | sfeed_web.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sfeed_web.c b/sfeed_web.c index 9a96959..4e7a8d5 100644 --- a/sfeed_web.c +++ b/sfeed_web.c @@ -7,8 +7,8 @@ #include "util.h" #include "xml.h" -static unsigned int isbase = 0, islink = 0, isfeedlink = 0, found = 0; -static char feedlink[4096] = "", basehref[4096] = "", feedtype[256] = ""; +static unsigned int isbase, islink, isfeedlink, found; +static char abslink[4096], feedlink[4096], basehref[4096], feedtype[256]; static void printfeedtype(const char *s, FILE *fp) @@ -46,7 +46,8 @@ xmltagstartparsed(XMLParser *p, const char *tag, size_t taglen, int isshort) printfeedtype(feedtype, stdout); putchar(' '); } - printlink(feedlink, basehref, stdout); + if(absuri(feedlink, basehref, abslink, sizeof(abslink)) != -1) + fputs(abslink, stdout); putchar('\n'); found++; } @@ -74,8 +75,9 @@ xmlattr(XMLParser *p, const char *tag, size_t taglen, const char *name, isfeedlink = 1; strlcpy(feedtype, value, sizeof(feedtype)); } - } else if(!strncasecmp(name, "href", namelen)) + } else if(!strncasecmp(name, "href", namelen)) { strlcpy(feedlink, value, sizeof(feedlink)); + } } } |