diff options
author | June McEnroe <june@causal.agency> | 2020-02-10 21:52:38 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2020-02-10 21:52:38 -0500 |
commit | c300cfbb73a9423df6223f3cc28d56d0f751158c (patch) | |
tree | f2e714c5dccb4eaa5a8cd2ac8ff8d2dab12addf3 | |
parent | Add To Be Taught, If Fortunate (diff) | |
download | src-c300cfbb73a9423df6223f3cc28d56d0f751158c.tar.gz src-c300cfbb73a9423df6223f3cc28d56d0f751158c.zip |
Duplicate effective URL before passing it back to curl
Apparently sometimes it didn't like receiving its own internal storage to parse again. Understandable.
Diffstat (limited to '')
-rw-r--r-- | bin/title.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/bin/title.c b/bin/title.c index d5238b1a..0168e2c9 100644 --- a/bin/title.c +++ b/bin/title.c @@ -127,8 +127,12 @@ static CURLcode fetchTitle(const char *url) { char *dest; curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_URL, &dest); + dest = strdup(dest); + if (!dest) err(EX_OSERR, "strdup"); + code = curl_easy_setopt(curl, CURLOPT_URL, dest); if (code) return code; + free(dest); body.len = 0; title = false; |