summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Santolaria <xsa@cvs.openbsd.org>2006-03-20 17:41:38 +0000
committerXavier Santolaria <xsa@cvs.openbsd.org>2006-03-20 17:41:38 +0000
commitfbf2d7c22ba18d34a0d6b63cfcde9ddcca2be2fc (patch)
treef4eed1c168bfff631b6de64b6366dc47ae421823
parent55d5e7e725642f7100044bf2647fa4771f134c12 (diff)
make `rcs -a' use cvs_strsplit() for easiness; OK joris@.
-rw-r--r--usr.bin/rcs/rcsprog.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/usr.bin/rcs/rcsprog.c b/usr.bin/rcs/rcsprog.c
index b3dc0a76223..2ab634b118c 100644
--- a/usr.bin/rcs/rcsprog.c
+++ b/usr.bin/rcs/rcsprog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcsprog.c,v 1.78 2006/03/18 04:00:34 ray Exp $ */
+/* $OpenBSD: rcsprog.c,v 1.79 2006/03/20 17:41:37 xsa Exp $ */
/*
* Copyright (c) 2005 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -448,10 +448,10 @@ rcs_usage(void)
int
rcs_main(int argc, char **argv)
{
- int i, ch, flags, kflag, lkmode;
+ int i, j, ch, flags, kflag, lkmode;
char fpath[MAXPATHLEN], ofpath[MAXPATHLEN];
char *logstr, *logmsg, *nflag, *descfile;
- char *alist, *comment, *elist, *unp, *sp;
+ char *alist, *comment, *elist;
mode_t fmode;
RCSFILE *file, *oldfile;
RCSNUM *logrev;
@@ -621,16 +621,13 @@ rcs_main(int argc, char **argv)
/* entries to add to the access list */
if (alist != NULL) {
- unp = alist;
- do {
- sp = strchr(unp, ',');
- if (sp != NULL)
- *(sp++) = '\0';
+ char **aargv;
- rcs_access_add(file, unp);
+ aargv = cvs_strsplit(alist, ",");
+ for (j = 0; aargv[j] != NULL; j++)
+ rcs_access_add(file, aargv[j]);
- unp = sp;
- } while (sp != NULL);
+ xfree(aargv);
}
if (comment != NULL)