mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-01 13:10:43 +00:00
Review revision for windows path separator detection in mg_upload
This commit is contained in:
1 parent
4bb9faaf50
commit
dfb7d928c2
1 file changed
+2
-3
+2
-3
@@ -4226,10 +4226,9 @@ int mg_upload(struct mg_connection *conn, const char *destination_dir) {
|
||||
// there is no other thread can save into the same file simultaneously.
|
||||
fp = NULL;
|
||||
// Construct destination file name. Do not allow paths to have slashes.
|
||||
if ((s = strrchr(fname, '/')) == NULL) {
|
||||
if ((s = strrchr(fname, '\\')) == NULL) {
|
||||
if ((s = strrchr(fname, '/')) == NULL &&
|
||||
(s = strrchr(fname, '\\')) == NULL) {
|
||||
s = fname;
|
||||
}
|
||||
}
|
||||
|
||||
// Open file in binary mode. TODO: set an exclusive lock.
|
||||
|
||||
Reference in new issue
Block a user