consolidate xz format comment. no code changes
[oweals/busybox.git] / libbb / platform.c
index fdd38825908ba49373f5c36c06d8e2d2d989f902..7a8b1765730fb19d184804afdfb2468f04fe6578 100644 (file)
@@ -30,7 +30,8 @@ int FAST_FUNC vasprintf(char **string_ptr, const char *format, va_list p)
 
        if (r < 128) {
                va_end(p2);
-               return xstrdup(buf);
+               *string_ptr = xstrdup(buf);
+               return r;
        }
 
        *string_ptr = xmalloc(r+1);
@@ -106,3 +107,30 @@ char* FAST_FUNC strcasestr(const char *s, const char *pattern)
        return 0;
 }
 #endif
+
+#ifndef HAVE_STRSEP
+/* Copyright (C) 2004 Free Software Foundation, Inc. */
+char* FAST_FUNC strsep(char **stringp, const char *delim)
+{
+       char *start = *stringp;
+       char *ptr;
+
+       if (!start)
+               return NULL;
+
+       if (!*delim)
+               ptr = start + strlen(start);
+       else {
+               ptr = strpbrk(start, delim);
+               if (!ptr) {
+                       *stringp = NULL;
+                       return start;
+               }
+       }
+
+       *ptr = '\0';
+       *stringp = ptr + 1;
+
+       return start;
+}
+#endif