瀏覽代碼

Fix: mg_upload file created with \ character (issue #51)

bel 10 年之前
父節點
當前提交
a65d96375a
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/civetweb.c

+ 2 - 0
src/civetweb.c

@@ -5553,6 +5553,8 @@ int mg_upload(struct mg_connection *conn, const char *destination_dir)
         if ((s = strrchr(fname, '/')) == NULL &&
             (s = strrchr(fname, '\\')) == NULL) {
             s = fname;
+        } else {
+            s++;
         }
 
         /* Open file in binary mode. TODO: set an exclusive lock. */