From 45bd009bb19b7c0aee253995f54c8b54abb48265 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 18 Oct 2002 13:51:00 +0000 Subject: [PATCH] if we found no string on the Location: line, don't try to follow it --- lib/transfer.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/transfer.c b/lib/transfer.c index 198864c30..5dcf3f28e 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -660,9 +660,11 @@ CURLcode Curl_readwrite(struct connectdata *conn, while(*ptr && !isspace((int)*ptr)) ptr++; backup = *ptr; /* store the ending letter */ - *ptr = '\0'; /* zero terminate */ - conn->newurl = strdup(start); /* clone string */ - *ptr = backup; /* restore ending letter */ + if(ptr != start) { + *ptr = '\0'; /* zero terminate */ + conn->newurl = strdup(start); /* clone string */ + *ptr = backup; /* restore ending letter */ + } } /*