summaryrefslogtreecommitdiff
path: root/usr.bin/rcs/ci.c
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2007-02-22 19:11:14 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2007-02-22 19:11:14 +0000
commit4284f660a7d46b89668c59de40295122e1be7c06 (patch)
treeddc59c779a46430a49475ffdf634c714b3239265 /usr.bin/rcs/ci.c
parent7b957b62ebc65d4f300af06463bb68b56cf3e597 (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/ci.c')
-rw-r--r--usr.bin/rcs/ci.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/rcs/ci.c b/usr.bin/rcs/ci.c
index de47e53a13a..3afa7079d02 100644
--- a/usr.bin/rcs/ci.c
+++ b/usr.bin/rcs/ci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ci.c,v 1.193 2007/02/14 16:07:29 niallo Exp $ */
+/* $OpenBSD: ci.c,v 1.194 2007/02/22 19:11:13 otto Exp $ */
/*
* Copyright (c) 2005, 2006 Niall O'Higgins <niallo@openbsd.org>
* All rights reserved.
@@ -233,8 +233,13 @@ checkin_main(int argc, char **argv)
if ((pb.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++) {
pb.filename = argv[i];
+ rcs_strip_suffix(pb.filename);
if ((workfile_fd = open(pb.filename, O_RDONLY)) == -1)
err(1, "%s", pb.filename);