From 6c00f4845f410681f736013e8139d721a201d747 Mon Sep 17 00:00:00 2001 From: Niall O'Higgins Date: Sat, 12 Nov 2005 22:50:00 +0000 Subject: - fix xsa breakage. char arrays on the stack are not NULL if empty. use flags instead. - add a few more flags defines while i'm here. --- usr.bin/rcs/rcsprog.c | 5 +++-- usr.bin/rcs/rcsprog.h | 21 ++++++++++++--------- 2 files changed, 15 insertions(+), 11 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/rcs/rcsprog.c b/usr.bin/rcs/rcsprog.c index 943c01db69c..fd5cb88bac0 100644 --- a/usr.bin/rcs/rcsprog.c +++ b/usr.bin/rcs/rcsprog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcsprog.c,v 1.40 2005/11/12 21:34:48 niallo Exp $ */ +/* $OpenBSD: rcsprog.c,v 1.41 2005/11/12 22:49:59 niallo Exp $ */ /* * Copyright (c) 2005 Jean-Francois Brousseau * All rights reserved. @@ -286,6 +286,7 @@ rcs_main(int argc, char **argv) case 'A': if (rcs_statfile(rcs_optarg, ofpath, sizeof(ofpath)) < 0) exit(1); + flags |= CO_ACLAPPEND; break; case 'a': alist = rcs_optarg; @@ -388,7 +389,7 @@ rcs_main(int argc, char **argv) } /* entries to add from */ - if (ofpath != NULL) { + if (flags & CO_ACLAPPEND) { /* XXX */ if ((oldfile = rcs_open(ofpath, RCS_READ)) == NULL) exit(1); diff --git a/usr.bin/rcs/rcsprog.h b/usr.bin/rcs/rcsprog.h index ec97e287979..9c15fb8c707 100644 --- a/usr.bin/rcs/rcsprog.h +++ b/usr.bin/rcs/rcsprog.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rcsprog.h,v 1.19 2005/11/08 09:22:48 xsa Exp $ */ +/* $OpenBSD: rcsprog.h,v 1.20 2005/11/12 22:49:59 niallo Exp $ */ /* * Copyright (c) 2005 Joris Vink * All rights reserved. @@ -30,18 +30,21 @@ #define RCS_TMPDIR_DEFAULT "/tmp" /* flags specific to ci.c */ -#define CI_SYMFORCE (1<<0) -#define CI_DEFAULT (1<<1) +#define CI_SYMFORCE (1<<0) +#define CI_DEFAULT (1<<1) +#define CI_INIT (1<<2) /* flags specific to co.c */ -#define CO_LOCK (1<<2) -#define CO_REVDATE (1<<2) -#define CO_STATE (1<<3) -#define CO_UNLOCK (1<<4) +#define CO_ACLAPPEND (1<<3) +#define CO_LOCK (1<<4) +#define CO_REVDATE (1<<5) +#define CO_STATE (1<<6) +#define CO_UNLOCK (1<<7) /* shared flags */ -#define FORCE (1<<5) -#define INTERACTIVE (1<<6) +#define FORCE (1<<8) +#define INTERACTIVE (1<<9) +#define NEWFILE (1<<10) extern char *__progname; extern const char rcs_version[]; -- cgit v1.2.3