-/* $OpenBSD: misc.c,v 1.208 2025/09/25 06:33:19 djm Exp $ */
+/* $OpenBSD: misc.c,v 1.209 2025/11/06 01:31:11 djm Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
* Copyright (c) 2005-2020 Damien Miller. All rights reserved.
return s + prefixlen;
}
+/* Append string 's' to a NULL-terminated array of strings */
+void
+stringlist_append(char ***listp, const char *s)
+{
+ size_t i = 0;
+
+ if (*listp == NULL)
+ *listp = xcalloc(2, sizeof(**listp));
+ else {
+ for (i = 0; (*listp)[i] != NULL; i++)
+ ; /* count */
+ *listp = xrecallocarray(*listp, i + 1, i + 2, sizeof(**listp));
+ }
+ (*listp)[i] = xstrdup(s);
+}
+
+void
+stringlist_free(char **list)
+{
+ size_t i = 0;
+
+ if (list == NULL)
+ return;
+ for (i = 0; list[i] != NULL; i++)
+ free(list[i]);
+ free(list);
+}
+
/* set/unset filedescriptor to non-blocking */
int
set_nonblock(int fd)
-/* $OpenBSD: misc.h,v 1.112 2025/09/25 06:33:19 djm Exp $ */
+/* $OpenBSD: misc.h,v 1.113 2025/11/06 01:31:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
const char *strprefix(const char *, const char *, int);
char *strdelim(char **);
char *strdelimw(char **);
+void stringlist_append(char ***listp, const char *s);
+void stringlist_free(char **list);
int set_nonblock(int);
int unset_nonblock(int);
void set_nodelay(int);
-/* $OpenBSD: ssh-add.c,v 1.181 2025/09/29 03:17:54 djm Exp $ */
+/* $OpenBSD: ssh-add.c,v 1.182 2025/11/06 01:31:11 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
return 0;
}
-/* Append string 's' to a NULL-terminated array of strings */
-static void
-stringlist_append(char ***listp, const char *s)
-{
- size_t i = 0;
-
- if (*listp == NULL)
- *listp = xcalloc(2, sizeof(**listp));
- else {
- for (i = 0; (*listp)[i] != NULL; i++)
- ; /* count */
- *listp = xrecallocarray(*listp, i + 1, i + 2, sizeof(**listp));
- }
- (*listp)[i] = xstrdup(s);
-}
-
-static void
-stringlist_free(char **list)
-{
- size_t i = 0;
-
- if (list == NULL)
- return;
- for (i = 0; list[i] != NULL; i++)
- free(list[i]);
- free(list);
-}
-
static void
free_dest_constraint_hop(struct dest_constraint_hop *dch)
{