diff options
-rw-r--r-- | usr.bin/cvs/checkout.c | 5 | ||||
-rw-r--r-- | usr.bin/cvs/cvs.h | 3 | ||||
-rw-r--r-- | usr.bin/cvs/update.c | 11 |
3 files changed, 12 insertions, 7 deletions
diff --git a/usr.bin/cvs/checkout.c b/usr.bin/cvs/checkout.c index 073f70e6c8a..b702909195e 100644 --- a/usr.bin/cvs/checkout.c +++ b/usr.bin/cvs/checkout.c @@ -1,4 +1,4 @@ -/* $OpenBSD: checkout.c,v 1.23 2005/05/24 20:04:43 joris Exp $ */ +/* $OpenBSD: checkout.c,v 1.24 2005/05/26 03:07:20 joris Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -108,6 +108,9 @@ cvs_checkout_init(struct cvs_cmd *cmd, int argc, char **argv, int *arg) return (CVS_EX_USAGE); } break; + case 'P': + cmd->cmd_flags |= CVS_CMD_PRUNEDIRS; + break; case 'N': shorten = 0; break; diff --git a/usr.bin/cvs/cvs.h b/usr.bin/cvs/cvs.h index d16e167a4f7..579f5b52b8c 100644 --- a/usr.bin/cvs/cvs.h +++ b/usr.bin/cvs/cvs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cvs.h,v 1.59 2005/05/24 20:04:43 joris Exp $ */ +/* $OpenBSD: cvs.h,v 1.60 2005/05/26 03:07:20 joris Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -140,6 +140,7 @@ #define CVS_CMD_SENDARGS1 0x04 #define CVS_CMD_SENDARGS2 0x08 #define CVS_CMD_SENDDIR 0x10 +#define CVS_CMD_PRUNEDIRS 0x20 struct cvs_cmd { diff --git a/usr.bin/cvs/update.c b/usr.bin/cvs/update.c index d7213c8bed5..6000ae3d6eb 100644 --- a/usr.bin/cvs/update.c +++ b/usr.bin/cvs/update.c @@ -1,4 +1,4 @@ -/* $OpenBSD: update.c,v 1.30 2005/05/24 04:21:54 jfb Exp $ */ +/* $OpenBSD: update.c,v 1.31 2005/05/26 03:07:20 joris Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -64,14 +64,14 @@ struct cvs_cmd cvs_cmd_update = { CVS_CMD_ALLOWSPEC | CVS_CMD_SENDARGS2 | CVS_CMD_SENDDIR }; -static int Pflag, dflag, Aflag; +static int dflag, Aflag; static int cvs_update_init(struct cvs_cmd *cmd, int argc, char **argv, int *arg) { int ch; - Pflag = dflag = Aflag = 0; + dflag = Aflag = 0; while ((ch = getopt(argc, argv, cmd->cmd_opts)) != -1) { switch (ch) { @@ -89,7 +89,7 @@ cvs_update_init(struct cvs_cmd *cmd, int argc, char **argv, int *arg) cmd->file_flags &= ~CF_RECURSE; break; case 'P': - Pflag = 1; + cmd->cmd_flags |= CVS_CMD_PRUNEDIRS; break; case 'p': cvs_noexec = 1; /* no locks will be created */ @@ -114,7 +114,8 @@ cvs_update_init(struct cvs_cmd *cmd, int argc, char **argv, int *arg) static int cvs_update_pre_exec(struct cvsroot *root) { - if (Pflag && cvs_sendarg(root, "-P", 0) < 0) + if ((cvs_cmd_update.cmd_flags & CVS_CMD_PRUNEDIRS) && + (cvs_sendarg(root, "-P", 0) < 0)) return (CVS_EX_PROTO); if (Aflag && cvs_sendarg(root, "-A", 0) < 0) return (CVS_EX_PROTO); |