projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8812f8f
)
path-util: return error if fnmatch() fails
author
Lennart Poettering
<lennart@poettering.net>
Mon, 29 Aug 2022 09:07:11 +0000
(11:07 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Wed, 31 Aug 2022 15:31:11 +0000
(17:31 +0200)
src/basic/path-util.c
patch
|
blob
|
history
diff --git
a/src/basic/path-util.c
b/src/basic/path-util.c
index c5f30b5be4f339a0dca584c3ade5757d7470fb1e..338377d9183094a66267094a4cd42da3875ae00c 100644
(file)
--- a/
src/basic/path-util.c
+++ b/
src/basic/path-util.c
@@
-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. */