chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove duplicated includes
[elogind.git]
/
src
/
shared
/
strv.c
diff --git
a/src/shared/strv.c
b/src/shared/strv.c
index e418312d52a6a9cb28a25994971591431f651f42..d44a72fc484d09966ac745066499a71cedd05c65 100644
(file)
--- a/
src/shared/strv.c
+++ b/
src/shared/strv.c
@@
-19,7
+19,6
@@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
@@
-81,9
+80,10
@@
void strv_clear(char **l) {
*l = NULL;
}
*l = NULL;
}
-
void
strv_free(char **l) {
+
char **
strv_free(char **l) {
strv_clear(l);
free(l);
strv_clear(l);
free(l);
+ return NULL;
}
char **strv_copy(char * const *l) {
}
char **strv_copy(char * const *l) {
@@
-278,7
+278,7
@@
char **strv_split_newlines(const char *s) {
return l;
}
return l;
}
-int strv_split_quoted(char ***t, const char *s,
bool relax
) {
+int strv_split_quoted(char ***t, const char *s,
UnquoteFlags flags
) {
size_t n = 0, allocated = 0;
_cleanup_strv_free_ char **l = NULL;
int r;
size_t n = 0, allocated = 0;
_cleanup_strv_free_ char **l = NULL;
int r;
@@
-289,7
+289,7
@@
int strv_split_quoted(char ***t, const char *s, bool relax) {
for (;;) {
_cleanup_free_ char *word = NULL;
for (;;) {
_cleanup_free_ char *word = NULL;
- r = unquote_first_word(&s, &word,
relax
);
+ r = unquote_first_word(&s, &word,
flags
);
if (r < 0)
return r;
if (r == 0)
if (r < 0)
return r;
if (r == 0)
@@
-692,3
+692,13
@@
char **strv_reverse(char **l) {
return l;
}
return l;
}
+
+bool strv_fnmatch(char* const* patterns, const char *s, int flags) {
+ char* const* p;
+
+ STRV_FOREACH(p, patterns)
+ if (fnmatch(*p, s, 0) == 0)
+ return true;
+
+ return false;
+}