diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-07-30 13:23:46 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-07-30 13:23:46 -0400 |
commit | 9cf661ddd274b51802635322fa9e3bac82833c15 (patch) | |
tree | 69f45feeaec4386b94e543fb03df41c7da8314f4 /src | |
parent | 520fa9f32e0bcc9591eb882f92a185a76476838b (diff) | |
download | stasis-9cf661ddd274b51802635322fa9e3bac82833c15.tar.gz |
Add pattern matching mode selector to get_wheel_file()
* Adds modes WHEEL_MATCH_EXACT and WHEEL_MATCH_ANY
Diffstat (limited to 'src')
-rw-r--r-- | src/wheel.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/wheel.c b/src/wheel.c index 8f48828..b96df57 100644 --- a/src/wheel.c +++ b/src/wheel.c @@ -1,6 +1,6 @@ #include "wheel.h" -struct Wheel *get_wheel_file(const char *basepath, const char *name, char *to_match[]) { +struct Wheel *get_wheel_file(const char *basepath, const char *name, char *to_match[], unsigned match_mode) { DIR *dp; struct dirent *rec; struct Wheel *result = NULL; @@ -38,7 +38,11 @@ struct Wheel *get_wheel_file(const char *basepath, const char *name, char *to_ma } } - if (!startswith(rec->d_name, name) || match != pattern_count) { + if (!startswith(rec->d_name, name)) { + continue; + } + + if (match_mode == WHEEL_MATCH_EXACT && match != pattern_count) { continue; } |