From f18cf87e3a59bed0ebed5cced6469c11791d33ed Mon Sep 17 00:00:00 2001 From: Duncaen Date: Thu, 13 Jun 2019 23:23:08 +0200 Subject: [PATCH] xbps-checkvers: fix bug noticed by fixing another bug --- bin/xbps-checkvers/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/xbps-checkvers/main.c b/bin/xbps-checkvers/main.c index 341de6e9..cffb0c45 100644 --- a/bin/xbps-checkvers/main.c +++ b/bin/xbps-checkvers/main.c @@ -429,10 +429,11 @@ rcv_sh_substitute(rcv_t *rcv, const char *str, size_t len, char **outp) for (ref = p; *p && p < str+len && (isalnum(*p) || *p == '_'); p++) ; reflen = p-ref; + p--; } item = map_find_n(rcv->env, ref, reflen); if ((strncmp(ref, item.k.s, reflen) == 0)) { - sbuf_str(out, item.v.s); + sbuf_mem(out, item.v.s, item.v.len); } else { sbuf_str(out, "NULL"); }