- char *strndup(const char *data, size_t size) const {
- return apr_pstrndup(pool_, data, size);
+ // XXX: this could be made much more efficient
+ __attribute__((__sentinel__))
+ char *strcat(const char *data, ...) {
+ size_t size(strlen(data)); {
+ va_list args;
+ va_start(args, data);
+
+ while (const char *arg = va_arg(args, const char *))
+ size += strlen(arg);
+
+ va_end(args);
+ }
+
+ char *copy(malloc<char>(size + 1)); {
+ va_list args;
+ va_start(args, data);
+
+ size_t offset(strlen(data));
+ memcpy(copy, data, offset);
+
+ while (const char *arg = va_arg(args, const char *)) {
+ size_t size(strlen(arg));
+ memcpy(copy + offset, arg, size);
+ offset += size;
+ }
+
+ va_end(args);
+ }
+
+ copy[size] = '\0';
+ return copy;