mirror of
https://github.com/cesanta/mongoose.git
synced 2024-11-28 13:49:01 +08:00
Fixed handle_delete() stat call
This commit is contained in:
parent
e31f3058fa
commit
3fa5c69f98
@ -2609,7 +2609,7 @@ static int remove_directory(const char *dir) {
|
|||||||
static void handle_delete(struct connection *conn, const char *path) {
|
static void handle_delete(struct connection *conn, const char *path) {
|
||||||
file_stat_t st;
|
file_stat_t st;
|
||||||
|
|
||||||
if (!stat(path, &st)) {
|
if (stat(path, &st) != 0) {
|
||||||
send_http_error(conn, 404, NULL);
|
send_http_error(conn, 404, NULL);
|
||||||
} else if (S_ISDIR(st.st_mode)) {
|
} else if (S_ISDIR(st.st_mode)) {
|
||||||
remove_directory(path);
|
remove_directory(path);
|
||||||
|
Loading…
Reference in New Issue
Block a user