Fixed the ability to download files with spaces in the name
[citadel.git] / webcit / downloads.c
index 18a136734e756b416ff1eb0d6b9697fee681b536..d3ffe37bb5f3fa399fc073b73f5432ab670dd886 100644 (file)
@@ -89,7 +89,9 @@ void download_file(char *filename)
        /* Setting to nonzero forces a MIME type of application/octet-stream */
        int force_download = 1;
        
-       serv_printf("OPEN %s", filename);
+       safestrncpy(buf, filename, sizeof buf);
+       unescape_input(buf);
+       serv_printf("OPEN %s", buf);
        serv_getln(buf, sizeof buf);
        if (buf[0] == '2') {
                bytes = extract_long(&buf[4], 0);