xbps-checkvers: fix bug noticed by fixing another bug

This commit is contained in:
Duncaen 2019-06-13 23:23:08 +02:00 committed by Duncan Overbruck
parent 684d2a7187
commit f18cf87e3a

View File

@ -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++) for (ref = p; *p && p < str+len && (isalnum(*p) || *p == '_'); p++)
; ;
reflen = p-ref; reflen = p-ref;
p--;
} }
item = map_find_n(rcv->env, ref, reflen); item = map_find_n(rcv->env, ref, reflen);
if ((strncmp(ref, item.k.s, reflen) == 0)) { if ((strncmp(ref, item.k.s, reflen) == 0)) {
sbuf_str(out, item.v.s); sbuf_mem(out, item.v.s, item.v.len);
} else { } else {
sbuf_str(out, "NULL"); sbuf_str(out, "NULL");
} }