diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2007-02-22 19:11:14 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2007-02-22 19:11:14 +0000 |
commit | 4284f660a7d46b89668c59de40295122e1be7c06 (patch) | |
tree | ddc59c779a46430a49475ffdf634c714b3239265 /usr.bin/rcs/co.c | |
parent | 7b957b62ebc65d4f300af06463bb68b56cf3e597 (diff) |
If a ,suffix file is given as an arg to ci and co, strip it. Avoids
potential disasters. Initial diff from niallo@, ok niallo@ joris@
Diffstat (limited to 'usr.bin/rcs/co.c')
-rw-r--r-- | usr.bin/rcs/co.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/rcs/co.c b/usr.bin/rcs/co.c index 3888bacb427..aca34e660d9 100644 --- a/usr.bin/rcs/co.c +++ b/usr.bin/rcs/co.c @@ -1,4 +1,4 @@ -/* $OpenBSD: co.c,v 1.103 2007/02/21 18:12:36 niallo Exp $ */ +/* $OpenBSD: co.c,v 1.104 2007/02/22 19:11:13 otto Exp $ */ /* * Copyright (c) 2005 Joris Vink <joris@openbsd.org> * All rights reserved. @@ -149,12 +149,17 @@ checkout_main(int argc, char **argv) if ((username = getlogin()) == NULL) err(1, "getlogin"); + /* If -x flag was not given, use default. */ + if (rcs_suffixes == NULL) + rcs_suffixes = RCS_DEFAULT_SUFFIX; + for (i = 0; i < argc; i++) { fd = rcs_choosefile(argv[i], fpath, sizeof(fpath)); if (fd < 0) { warn("%s", fpath); continue; } + rcs_strip_suffix(argv[i]); if (!(flags & QUIET)) (void)fprintf(stderr, "%s --> %s\n", fpath, |