diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2021-06-10 00:37:08 +0000 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2021-06-10 00:37:08 +0000 |
commit | 15b5916ed82c8de48b85d7b7afe670cb00e79796 (patch) | |
tree | b7891e7faa9ffaa27911b367d0551a38d03a53a6 /WWW/Library/Implementation/HTNews.c | |
parent | c2036b385da968e77c3abbefa44cb4c88eff9512 (diff) | |
download | lynx-snapshots-15b5916ed82c8de48b85d7b7afe670cb00e79796.tar.gz |
snapshot of project "lynx", label v2-9-0dev_6j
Diffstat (limited to 'WWW/Library/Implementation/HTNews.c')
-rw-r--r-- | WWW/Library/Implementation/HTNews.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/WWW/Library/Implementation/HTNews.c b/WWW/Library/Implementation/HTNews.c index 5fd0e99d..c6c25636 100644 --- a/WWW/Library/Implementation/HTNews.c +++ b/WWW/Library/Implementation/HTNews.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTNews.c,v 1.75 2020/01/21 22:12:00 tom Exp $ + * $LynxId: HTNews.c,v 1.78 2021/06/09 19:29:36 tom Exp $ * * NEWS ACCESS HTNews.c * =========== @@ -2300,7 +2300,7 @@ static int HTLoadNews(const char *arg, } else if (*(arg + 5) == '/' && *(arg + 6) != '/') { p1 = (arg + 6); } else { - p1 = (cp + 1); + p1 = (cp ? (cp + 1) : (arg + 6)); } if (!(cp = HTParse(arg, "", PARSE_HOST)) || *cp == '\0') { if (s >= 0 && NewsHost && strcasecomp(NewsHost, HTNewsHost)) { @@ -2334,7 +2334,7 @@ static int HTLoadNews(const char *arg, } else if (*(arg + 6) == '/' && *(arg + 7) != '/') { p1 = (arg + 7); } else { - p1 = (cp + 1); + p1 = (cp ? (cp + 1) : (arg + 7)); } if (!(cp = HTParse(arg, "", PARSE_HOST)) || *cp == '\0') { if (s >= 0 && NewsHost && strcasecomp(NewsHost, HTNewsHost)) { @@ -2368,7 +2368,7 @@ static int HTLoadNews(const char *arg, } else if (*(arg + 6) != '/') { p1 = (arg + 6); } else { - p1 = (cp + 1); + p1 = (cp ? (cp + 1) : (arg + 6)); } if (!(cp = HTParse(arg, "", PARSE_HOST)) || *cp == '\0') { if (s >= 0 && NewsHost && strcasecomp(NewsHost, HTNewsHost)) { @@ -2436,16 +2436,18 @@ static int HTLoadNews(const char *arg, p1 = (strrchr(arg, ':') + 1); } } else { + char *cp2; + /* * Reset p1 so that it points to the newsgroup (or a wildcard), * or the article. */ - if (!(cp = strrchr((p1 + 6), '/')) || *(cp + 1) == '\0') { + if (!(cp2 = strrchr((p1 + 6), '/')) || *(cp2 + 1) == '\0') { p1 = "*"; group_wanted = FALSE; list_wanted = TRUE; } else { - p1 = (cp + 1); + p1 = (cp2 + 1); } } } |