Change match to fnmatch

follow the kernel side change

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2021-08-01 23:20:18 +08:00
committed by Alan Carvalho de Assis
parent 1120bc844a
commit ad3f44bc77
3 changed files with 11 additions and 12 deletions

View File

@@ -7,7 +7,7 @@
*
* Derived from the file of the same name in the original THTTPD package:
*
* Copyright <20> 1995 by Jef Poskanzer <jef@mail.acme.com>.
* Copyright 1995 by Jef Poskanzer <jef@mail.acme.com>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -46,8 +46,7 @@
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <nuttx/lib/regex.h>
#include <fnmatch.h>
#include "config.h"
@@ -339,7 +338,7 @@ static int check_filename(char *filename)
/* Ensure that we are not reading a CGI file. */
if (cgi_pattern != (char *)0 && match(cgi_pattern, filename))
if (cgi_pattern != (char *)0 && !fnmatch(cgi_pattern, filename, 0))
{
return 0;
}