commit 5b9d324b444dc94f6850b07e9a9d534562323731
parent eee154c8b0da6fa536e93b08747e26ccf686d722
Author: Christian Grothoff <christian@grothoff.org>
Date: Mon, 9 Jul 2012 11:43:34 +0000
-LRN: fix url generation on MinGW32
Diffstat:
1 file changed, 20 insertions(+), 0 deletions(-)
diff --git a/src/testcurl/https/tls_test_common.c b/src/testcurl/https/tls_test_common.c
@@ -276,6 +276,26 @@ gen_test_file_url (char *url, int port)
strerror (errno));
ret = -1;
}
+#if WINDOWS
+ {
+ int i;
+ for (i = 0; i < doc_path_len; i++)
+ {
+ if (doc_path[i] == 0)
+ break;
+ if (doc_path[i] == '\\')
+ {
+ doc_path[i] = '/';
+ }
+ if (doc_path[i] != ':')
+ continue;
+ if (i == 0)
+ break;
+ doc_path[i] = doc_path[i - 1];
+ doc_path[i - 1] = '/';
+ }
+ }
+#endif
/* construct url - this might use doc_path */
if (sprintf (url, "%s:%d%s/%s", "https://127.0.0.1", port,
doc_path, "urlpath") < 0)