[openssh-commits] [openssh] 01/01: upstream: Make dollar_expand variadic and pass a real va_list to
git+noreply at mindrot.org
git+noreply at mindrot.org
Fri May 29 21:53:48 AEST 2020
This is an automated email from the git hooks/post-receive script.
dtucker pushed a commit to branch master
in repository openssh.
commit 712ac1efb687a945a89db6aa3e998c1a17b38653
Author: dtucker at openbsd.org <dtucker at openbsd.org>
Date: Fri May 29 11:17:56 2020 +0000
upstream: Make dollar_expand variadic and pass a real va_list to
vdollar_percent_expand. Fixes build error on arm64 spotted by otto at .
OpenBSD-Commit-ID: 181910d7ae489f40ad609b4cf4a20f3d068a7279
---
misc.c | 15 ++++++++++++---
misc.h | 4 ++--
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/misc.c b/misc.c
index 9ba913c3..f29e9bc3 100644
--- a/misc.c
+++ b/misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.c,v 1.151 2020/05/29 09:02:44 dtucker Exp $ */
+/* $OpenBSD: misc.c,v 1.152 2020/05/29 11:17:56 dtucker Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
* Copyright (c) 2005-2020 Damien Miller. All rights reserved.
@@ -1207,13 +1207,22 @@ vdollar_percent_expand(int *parseerror, int dollar, int percent,
#undef EXPAND_MAX_KEYS
}
+/*
+ * Expand only environment variables.
+ * Note that although this function is variadic like the other similar
+ * functions, any such arguments will be unused.
+ */
+
char *
-dollar_expand(int *parseerr, const char *string)
+dollar_expand(int *parseerr, const char *string, ...)
{
char *ret;
int err;
+ va_list ap;
- ret = vdollar_percent_expand(&err, 1, 0, string, NULL);
+ va_start(ap, string);
+ ret = vdollar_percent_expand(&err, 1, 0, string, ap);
+ va_end(ap);
if (parseerr != NULL)
*parseerr = err;
return ret;
diff --git a/misc.h b/misc.h
index 7e9f5ac1..ab94a79c 100644
--- a/misc.h
+++ b/misc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.h,v 1.86 2020/05/29 04:25:40 dtucker Exp $ */
+/* $OpenBSD: misc.h,v 1.87 2020/05/29 11:17:56 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo at cs.hut.fi>
@@ -69,7 +69,7 @@ long convtime(const char *);
const char *fmt_timeframe(time_t t);
char *tilde_expand_filename(const char *, uid_t);
-char *dollar_expand(int *, const char *string);
+char *dollar_expand(int *, const char *string, ...);
char *percent_expand(const char *, ...) __attribute__((__sentinel__));
char *percent_dollar_expand(const char *, ...) __attribute__((__sentinel__));
char *tohex(const void *, size_t);
--
To stop receiving notification emails like this one, please contact
djm at mindrot.org.
More information about the openssh-commits
mailing list