summaryrefslogtreecommitdiff
path: root/rushs/tinyprintf/simple_fnmatch/simple_fnmatch.c
diff options
context:
space:
mode:
authorMartial Simon <msimon_fr@hotmail.com>2025-10-11 22:19:00 +0200
committerMartial Simon <msimon_fr@hotmail.com>2025-10-11 22:19:00 +0200
commit73c2b00a10c5786ddeeacc915e233fd4df1c9321 (patch)
treee299ea4e8ac161b2b21170172ff8f182c1c3fe1a /rushs/tinyprintf/simple_fnmatch/simple_fnmatch.c
parentc9b6b9a5ca082fe7c1b6f58d7713f785a9eb6a5c (diff)
fix: evalexpr & tinyprintf contenaient toute la piscine
Diffstat (limited to 'rushs/tinyprintf/simple_fnmatch/simple_fnmatch.c')
-rw-r--r--rushs/tinyprintf/simple_fnmatch/simple_fnmatch.c46
1 files changed, 0 insertions, 46 deletions
diff --git a/rushs/tinyprintf/simple_fnmatch/simple_fnmatch.c b/rushs/tinyprintf/simple_fnmatch/simple_fnmatch.c
deleted file mode 100644
index d40353f..0000000
--- a/rushs/tinyprintf/simple_fnmatch/simple_fnmatch.c
+++ /dev/null
@@ -1,46 +0,0 @@
-#include "simple_fnmatch.h"
-
-int simple_fnmatch(const char *pattern, const char *string)
-{
- if (!pattern || !string)
- return FNM_NOMATCH;
- if (*pattern == '*' && pattern[1] == '\0')
- return 0;
- while (*pattern && *string)
- {
- if (*pattern == '?')
- {
- pattern++;
- string++;
- }
- else if (*pattern == '\\')
- {
- pattern++;
- if (!pattern || *pattern != *string)
- return FNM_NOMATCH;
- string++;
- pattern++;
- }
- else if (*pattern == '*')
- {
- pattern++;
- while (*string && simple_fnmatch(pattern, string))
- string++;
- if (*string)
- return 0;
- }
- else if (*pattern != *string)
- return FNM_NOMATCH;
- else
- {
- string++;
- pattern++;
- }
- }
-
- if (*pattern == '*' && pattern[1] == '\0')
- return 0;
- if (*string || *pattern)
- return FNM_NOMATCH;
- return 0;
-}