diff options
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)); + } } } |