From 4284f660a7d46b89668c59de40295122e1be7c06 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Thu, 22 Feb 2007 19:11:14 +0000 Subject: 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@ --- usr.bin/rcs/ci.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'usr.bin/rcs/ci.c') 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 * 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); -- cgit v1.2.3