From 87d51e5692b0d79fa02a50579d3b37202827840c Mon Sep 17 00:00:00 2001 From: Joris Vink Date: Thu, 19 Mar 2009 09:55:20 +0000 Subject: only pass the real $var to expand_vars() instead of the entire line, this way commitinfo and stuff works again. found by myself the hard way, fix by tobias@ who's not around to commit. --- usr.bin/cvs/trigger.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'usr.bin/cvs/trigger.c') diff --git a/usr.bin/cvs/trigger.c b/usr.bin/cvs/trigger.c index fe9df8ba37a..54f64334fb4 100644 --- a/usr.bin/cvs/trigger.c +++ b/usr.bin/cvs/trigger.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trigger.c,v 1.16 2008/08/29 09:51:21 tobias Exp $ */ +/* $OpenBSD: trigger.c,v 1.17 2009/03/19 09:55:19 joris Exp $ */ /* * Copyright (c) 2008 Tobias Stoeckmann * Copyright (c) 2008 Jonathan Armani @@ -280,19 +280,20 @@ again: if (p[pos] == '\0') goto bad; } else { - if (!isalpha(*p)) { + for (pos = 0; isalpha(p[pos]); pos++) + ; + if (pos == 0) { cvs_log(LP_ERR, "unrecognized variable syntax"); goto bad; } - pos = strcspn(p, " \t"); } q = xmalloc(pos + 1); memcpy(q, p, pos); q[pos] = '\0'; if (expand_var(buf, q)) goto bad; - p += pos; + p += pos - (*(p - 1) == '{' ? 0 : 1); } else { switch (*p) { case '\0': -- cgit v1.2.3