Skip to content

Commit b96116f

Browse files
committed
include: zephyr: posix: removed FNM_NOSYS and FNM_NORES
Removed two error codes since they are not official posix errors Signed-off-by: Harun Spago <harun.spago.code@gmail.com>
1 parent cde5eab commit b96116f

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

include/zephyr/posix/fnmatch.h

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@
3636
#ifndef _FNMATCH_H_
3737
#define _FNMATCH_H_
3838

39-
#define FNM_NOMATCH 1 /* Match failed. */
40-
#define FNM_NOSYS 2 /* Function not implemented. */
41-
#define FNM_NORES 3 /* Out of resources */
39+
#define FNM_NOMATCH 1 /**< Match failed */
4240

4341
#define FNM_NOESCAPE 0x01 /* Disable backslash escaping. */
4442
#define FNM_PATHNAME 0x02 /* Slash must be matched by slash. */
@@ -50,7 +48,18 @@
5048
extern "C" {
5149
#endif
5250

53-
int fnmatch(const char *, const char *, int);
51+
/**
52+
* @brief Check if a filename or input string matches a shell-style matching pattern.
53+
*
54+
* @param pattern pattern that is matched against @param string
55+
* @param string input string to match against @param pattern
56+
* @param flags flags used to signal special matching conditions such as @ref FNM_NOESCAPE
57+
*
58+
*
59+
* @retval 0 pattern found in string
60+
* @retval FNM_NOMATCH pattern not found in string
61+
*/
62+
int fnmatch(const char *pattern, const char *string, int flags);
5463

5564
#ifdef __cplusplus
5665
}

lib/posix/c_lib_ext/fnmatch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ static int fnmatchx(const char *pattern, const char *string, int flags, size_t r
303303
}
304304

305305
if (recursion-- == 0) {
306-
return FNM_NORES;
306+
return FNM_NOMATCH;
307307
}
308308

309309
for (stringstart = string;;) {

0 commit comments

Comments
 (0)