diff options
author | 2008-06-12 17:06:17 +0000 | |
---|---|---|
committer | 2008-06-12 17:06:17 +0000 | |
commit | d1af932dd0a2ee07f60ef438226091e7fed58705 (patch) | |
tree | 17f336f2a5a67a75642773d44b825eb100115b70 | |
parent | Oops, do not dereference a NULL function pointer used as an array end (diff) | |
download | wireguard-openbsd-d1af932dd0a2ee07f60ef438226091e7fed58705.tar.xz wireguard-openbsd-d1af932dd0a2ee07f60ef438226091e7fed58705.zip |
we should be able to handle symbol names that are also RCS tokens,
gnu cvs supports this and we should too really.
allows opencvs to properly checkout netbsd trees.
spotted & tested by rivo nurges
ok tobias@
-rw-r--r-- | usr.bin/cvs/rcs.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c index 62da76238c9..f6355ea3018 100644 --- a/usr.bin/cvs/rcs.c +++ b/usr.bin/cvs/rcs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcs.c,v 1.270 2008/06/12 07:16:14 joris Exp $ */ +/* $OpenBSD: rcs.c,v 1.271 2008/06/12 17:06:17 joris Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -237,6 +237,8 @@ static void rcs_strprint(const u_char *, size_t, FILE *); static void rcs_kwexp_line(char *, struct rcs_delta *, struct cvs_lines *, struct cvs_line *, int mode); +static int rcs_ignore_keys = 0; + RCSFILE * rcs_open(const char *path, int fd, int flags, ...) { @@ -1721,6 +1723,7 @@ rcs_parse_admin(RCSFILE *rfp) goto fail; break; case RCS_TOK_SYMBOLS: + rcs_ignore_keys = 1; if (rcs_parse_symbols(rfp) < 0) goto fail; break; @@ -1734,6 +1737,9 @@ rcs_parse_admin(RCSFILE *rfp) RCS_TOKSTR(rfp)); goto fail; } + + rcs_ignore_keys = 0; + } fail: @@ -2302,7 +2308,7 @@ rcs_gettok(RCSFILE *rfp) } *bp = '\0'; - if (type != RCS_TOK_ERR) { + if (type != RCS_TOK_ERR && rcs_ignore_keys != 1) { for (i = 0; i < RCS_NKEYS; i++) { if (strcmp(rcs_keys[i].rk_str, pdp->rp_buf) == 0) { |