Fixed the ability to download files with spaces in the name
authorArt Cancro <ajc@citadel.org>
Tue, 13 Mar 2007 03:06:05 +0000 (03:06 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 13 Mar 2007 03:06:05 +0000 (03:06 +0000)
webcit/downloads.c
webcit/webcit.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);
index 0c1caf7469e0b861225886cc823a7f73245b1be3..eeed42acca84a9f7ad9a4cd3475abb7df4283d7b 100644 (file)
@@ -256,7 +256,6 @@ void escputs(char *strbuf)
 
 /** 
  * \brief Escape a string for feeding out as a URL.
- * Returns a pointer to a buffer that must be freed by the caller!
  * \param outbuf the output buffer
  * \param strbuf the input buffer
  */