chiark / gitweb /
tests: add tests for environment serialization
[elogind.git] / src / basic / strv.c
index baaa72e674dc98b3ca3126efc1e385019ef361d0..c2defbe970149cc8a0423f70362e44ce4f691d68 100644 (file)
@@ -87,8 +87,7 @@ void strv_clear(char **l) {
 
 char **strv_free(char **l) {
         strv_clear(l);
-        free(l);
-        return NULL;
+        return mfree(l);
 }
 
 char **strv_free_erase(char **l) {
@@ -323,6 +322,7 @@ char **strv_split_newlines(const char *s) {
 
         return l;
 }
+#endif // 0
 
 int strv_split_extract(char ***t, const char *s, const char *separators, ExtractFlags flags) {
         _cleanup_strv_free_ char **l = NULL;
@@ -361,7 +361,6 @@ int strv_split_extract(char ***t, const char *s, const char *separators, Extract
 
         return (int) n;
 }
-#endif // 0
 
 char *strv_join(char **l, const char *separator) {
         char *r, *e;
@@ -431,8 +430,7 @@ char *strv_join_quoted(char **l) {
         return buf;
 
  oom:
-        free(buf);
-        return NULL;
+        return mfree(buf);
 }
 #endif // 0
 
@@ -792,7 +790,6 @@ char **strv_sort(char **l) {
         return l;
 }
 
-#if 0 /// UNNEEDED by elogind
 bool strv_equal(char **a, char **b) {
 
         if (strv_isempty(a))
@@ -815,6 +812,7 @@ void strv_print(char **l) {
                 puts(*s);
 }
 
+#if 0 /// UNNEEDED by elogind
 int strv_extendf(char ***l, const char *format, ...) {
         va_list ap;
         char *x;
@@ -882,8 +880,7 @@ char ***strv_free_free(char ***l) {
         for (i = l; *i; i++)
                 strv_free(*i);
 
-        free(l);
-        return NULL;
+        return mfree(l);
 }
 
 char **strv_skip(char **l, size_t n) {