mirror of
https://github.com/systemd/systemd.git
synced 2025-02-18 21:57:48 +03:00
path-util: return error if fnmatch() fails
This commit is contained in:
parent
8812f8fc65
commit
6eeadaa141
@ -1336,8 +1336,11 @@ int path_glob_can_match(const char *pattern, const char *prefix, char **ret) {
|
||||
if (!h)
|
||||
return -ENOMEM;
|
||||
|
||||
if (fnmatch(g, h, 0) != 0)
|
||||
r = fnmatch(g, h, 0);
|
||||
if (r == FNM_NOMATCH)
|
||||
break;
|
||||
if (r != 0) /* Failure to process pattern? */
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* The pattern does not match the prefix. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user