libc: Rename match to fnmatch

specified here:
https://pubs.opengroup.org/onlinepubs/007904875/functions/fnmatch.html

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2021-08-01 16:54:08 +08:00
committed by Alan Carvalho de Assis
parent 59bff123e6
commit a262eebe34
6 changed files with 330 additions and 8 deletions
+4 -3
View File
@@ -31,6 +31,7 @@
#include <stdbool.h>
#include <string.h>
#include <fcntl.h>
#include <fnmatch.h>
#include <libgen.h>
#include <assert.h>
#include <errno.h>
@@ -40,7 +41,6 @@
#include <nuttx/fs/fs.h>
#include <nuttx/fs/procfs.h>
#include <nuttx/fs/dirent.h>
#include <nuttx/lib/regex.h>
#include <nuttx/net/netdev.h>
#include "netdev/netdev.h"
@@ -185,7 +185,7 @@ static int netprocfs_open(FAR struct file *filep, FAR const char *relpath,
* table support is initialized.
*/
if (match("net/route/**", relpath))
if (fnmatch("net/route/**", relpath, 0) == 0)
{
/* Use the /net/route directory */
@@ -393,7 +393,8 @@ static int netprocfs_opendir(FAR const char *relpath,
*/
#ifdef CONFIG_NET_ROUTE
if (match("net/route", relpath) || match("net/route/**", relpath))
if (fnmatch("net/route", relpath, 0) == 0 ||
fnmatch("net/route/**", relpath, 0) == 0)
{
/* Use the /net/route directory */