diff options
author | Joris Vink <joris@cvs.openbsd.org> | 2009-03-19 09:55:20 +0000 |
---|---|---|
committer | Joris Vink <joris@cvs.openbsd.org> | 2009-03-19 09:55:20 +0000 |
commit | 87d51e5692b0d79fa02a50579d3b37202827840c (patch) | |
tree | 2535332a9dfd4b01c458fe4eba94586039f492bc /usr.bin/cvs | |
parent | 751a338abdc152e003e2ba7329cf661e154f06c9 (diff) |
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.
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r-- | usr.bin/cvs/trigger.c | 9 |
1 files changed, 5 insertions, 4 deletions
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 <tobias@openbsd.org> * Copyright (c) 2008 Jonathan Armani <dbd@asystant.net> @@ -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': |