casaroli commented on code in PR #21097:
URL: https://github.com/apache/nuttx/pull/21097#discussion_r4415593165
##########
libs/libc/misc/lib_fnmatch.c:
##########
@@ -35,13 +35,63 @@
* Included Files
****************************************************************************/
+#include <ctype.h>
#include <fnmatch.h>
#include <string.h>
/****************************************************************************
* Private Functions
****************************************************************************/
+/****************************************************************************
+ * Name: fnmatch_eq
+ *
+ * Description:
+ * Compare one character of the pattern with one of the string. With
+ * FNM_CASEFOLD, upper and lower case are the same.
+ *
+ ****************************************************************************/
+
+static int fnmatch_eq(char p, char c, int flags)
Review Comment:
Done.
##########
libs/libc/misc/lib_fnmatch.c:
##########
@@ -35,13 +35,63 @@
* Included Files
****************************************************************************/
+#include <ctype.h>
#include <fnmatch.h>
#include <string.h>
/****************************************************************************
* Private Functions
****************************************************************************/
+/****************************************************************************
+ * Name: fnmatch_eq
+ *
+ * Description:
+ * Compare one character of the pattern with one of the string. With
+ * FNM_CASEFOLD, upper and lower case are the same.
+ *
+ ****************************************************************************/
+
+static int fnmatch_eq(char p, char c, int flags)
+{
+ if (p == c)
+ {
+ return 1;
+ }
+
+ return (flags & FNM_CASEFOLD) != 0 &&
+ tolower((unsigned char)p) == tolower((unsigned char)c);
+}
+
+/****************************************************************************
+ * Name: fnmatch_range
+ *
+ * Description:
+ * Return non-zero if c is in the range first-last. With FNM_CASEFOLD,
+ * the other case of c also matches.
+ *
+ ****************************************************************************/
+
+static int fnmatch_range(char first, char last, char c, int flags)
Review Comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]