diff options
| author | Martial Simon <msimon_fr@hotmail.com> | 2025-10-11 22:19:00 +0200 |
|---|---|---|
| committer | Martial Simon <msimon_fr@hotmail.com> | 2025-10-11 22:19:00 +0200 |
| commit | 73c2b00a10c5786ddeeacc915e233fd4df1c9321 (patch) | |
| tree | e299ea4e8ac161b2b21170172ff8f182c1c3fe1a /rushs/tinyprintf/simple_fnmatch | |
| parent | c9b6b9a5ca082fe7c1b6f58d7713f785a9eb6a5c (diff) | |
fix: evalexpr & tinyprintf contenaient toute la piscine
Diffstat (limited to 'rushs/tinyprintf/simple_fnmatch')
| -rw-r--r-- | rushs/tinyprintf/simple_fnmatch/simple_fnmatch.c | 46 | ||||
| -rw-r--r-- | rushs/tinyprintf/simple_fnmatch/simple_fnmatch.h | 8 |
2 files changed, 0 insertions, 54 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; -} diff --git a/rushs/tinyprintf/simple_fnmatch/simple_fnmatch.h b/rushs/tinyprintf/simple_fnmatch/simple_fnmatch.h deleted file mode 100644 index e1ae166..0000000 --- a/rushs/tinyprintf/simple_fnmatch/simple_fnmatch.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef SIMPLE_FNMATCH_H -#define SIMPLE_FNMATCH_H - -#define FNM_NOMATCH 1 - -int simple_fnmatch(const char *pattern, const char *string); - -#endif /* !SIMPLE_FNMATCH_H */ |
