summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2006-03-06 09:41:54 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2006-03-06 09:41:54 +0000
commit416dc1e2bf0b1670cd0b3ad59f2dce79bbbb01f9 (patch)
treebc0343c778ecf54df77d1d6e896781c46252bab3
parentf9eae3a7de1b02e3712bb420a14f5a0299aa524f (diff)
many spacing cleanups
-rw-r--r--usr.bin/rcs/ci.12
-rw-r--r--usr.bin/rcs/ci.c131
-rw-r--r--usr.bin/rcs/co.12
-rw-r--r--usr.bin/rcs/ident.c4
-rw-r--r--usr.bin/rcs/rcsclean.12
-rw-r--r--usr.bin/rcs/rcsdiff.12
-rw-r--r--usr.bin/rcs/rcsdiff.c4
-rw-r--r--usr.bin/rcs/rcsintro.72
-rw-r--r--usr.bin/rcs/rcsmerge.12
-rw-r--r--usr.bin/rcs/rcsprog.c9
-rw-r--r--usr.bin/rcs/rlog.12
11 files changed, 80 insertions, 82 deletions
diff --git a/usr.bin/rcs/ci.1 b/usr.bin/rcs/ci.1
index deb25f7d074..a7c0822aeb7 100644
--- a/usr.bin/rcs/ci.1
+++ b/usr.bin/rcs/ci.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ci.1,v 1.24 2006/03/05 09:04:54 jmc Exp $
+.\" $OpenBSD: ci.1,v 1.25 2006/03/06 09:41:53 deraadt Exp $
.\"
.\" Copyright (c) 2005 Niall O'Higgins <niallo@openbsd.org>
.\" All rights reserved.
diff --git a/usr.bin/rcs/ci.c b/usr.bin/rcs/ci.c
index c4f86c36c26..890a6d2b9be 100644
--- a/usr.bin/rcs/ci.c
+++ b/usr.bin/rcs/ci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ci.c,v 1.106 2006/03/05 17:35:24 niallo Exp $ */
+/* $OpenBSD: ci.c,v 1.107 2006/03/06 09:41:53 deraadt Exp $ */
/*
* Copyright (c) 2005, 2006 Niall O'Higgins <niallo@openbsd.org>
* All rights reserved.
@@ -29,32 +29,27 @@
#include "rcsprog.h"
#include "diff.h"
-#define CI_OPTSTRING "d::f::i::j::k::l::m:M::N:n:qr::s:Tt:u::Vw:x:"
-#define DATE_NOW -1
-#define DATE_MTIME -2
-
-#define KW_ID "Id"
-#define KW_AUTHOR "Author"
-#define KW_DATE "Date"
-#define KW_STATE "State"
-#define KW_REVISION "Revision"
-#define KW_TYPE_ID 1
-#define KW_TYPE_AUTHOR 2
-#define KW_TYPE_DATE 3
-#define KW_TYPE_STATE 4
-#define KW_TYPE_REVISION 5
-#define KW_NUMTOKS_ID 10
-#define KW_NUMTOKS_AUTHOR 3
-#define KW_NUMTOKS_DATE 4
-#define KW_NUMTOKS_STATE 3
-#define KW_NUMTOKS_REVISION 3
-
-#define LOG_INIT "Initial revision"
-#define LOG_PROMPT "enter log message, terminated with a single '.' " \
- "or end of file:\n>> "
-#define DESC_PROMPT "enter description, terminated with single '.' " \
- "or end of file:\nNOTE: This is NOT the log message!" \
- "\n>> "
+#define CI_OPTSTRING "d::f::i::j::k::l::m:M::N:n:qr::s:Tt:u::Vw:x:"
+#define DATE_NOW -1
+#define DATE_MTIME -2
+
+#define KW_ID "Id"
+#define KW_AUTHOR "Author"
+#define KW_DATE "Date"
+#define KW_STATE "State"
+#define KW_REVISION "Revision"
+
+#define KW_TYPE_ID 1
+#define KW_TYPE_AUTHOR 2
+#define KW_TYPE_DATE 3
+#define KW_TYPE_STATE 4
+#define KW_TYPE_REVISION 5
+
+#define KW_NUMTOKS_ID 10
+#define KW_NUMTOKS_AUTHOR 3
+#define KW_NUMTOKS_DATE 4
+#define KW_NUMTOKS_STATE 3
+#define KW_NUMTOKS_REVISION 3
extern struct rcs_kw rcs_expkw[];
@@ -77,11 +72,11 @@ static char *checkin_getdesc(void);
static char *checkin_getinput(const char *);
static char *checkin_getlogmsg(RCSNUM *, RCSNUM *);
static int checkin_init(struct checkin_params *);
-static int checkin_keywordscan(char *, RCSNUM **, time_t *, char **,
+static int checkin_keywordscan(char *, RCSNUM **, time_t *, char **,
char **);
-static int checkin_keywordtype(char *);
+static int checkin_keywordtype(char *);
static int checkin_mtimedate(struct checkin_params *);
-static void checkin_parsekeyword(char *, RCSNUM **, time_t *, char **,
+static void checkin_parsekeyword(char *, RCSNUM **, time_t *, char **,
char **);
static int checkin_update(struct checkin_params *);
static void checkin_revert(struct checkin_params *);
@@ -91,9 +86,9 @@ checkin_usage(void)
{
fprintf(stderr,
"usage: ci [-MNqTV] [-d[date]] [-f[rev]] [-i[rev]] [-j[rev]]\n"
- " [-k[rev]] [-l[rev]] [-M[rev]] [-mmsg] [-Nsymbol]\n"
- " [-nsymbol] [-r[rev]] [-sstate] [-tfile|str] [-u[rev]]\n"
- " [-wusername] [-xsuffixes] file ...\n");
+ " [-k[rev]] [-l[rev]] [-M[rev]] [-mmsg] [-Nsymbol]\n"
+ " [-nsymbol] [-r[rev]] [-sstate] [-tfile|str] [-u[rev]]\n"
+ " [-wusername] [-xsuffixes] file ...\n");
}
@@ -268,7 +263,7 @@ checkin_main(int argc, char **argv)
if (verbose == 1)
printf("%s <-- %s\n", pb.fpath, pb.filename);
-
+
if (pb.flags & NEWFILE)
status = checkin_init(&pb);
else
@@ -370,7 +365,8 @@ checkin_getlogmsg(RCSNUM *rev, RCSNUM *rev2)
printf("new revision: %s; previous revision: %s\n", nrev,
prev);
- rcs_msg = checkin_getinput(LOG_PROMPT);
+ rcs_msg = checkin_getinput("enter log message, terminated with a "
+ "single '.' or end of file:\n>> ");
return (rcs_msg);
}
@@ -386,7 +382,9 @@ checkin_getdesc()
{
char *description;
- description = checkin_getinput(DESC_PROMPT);
+ description = checkin_getinput("enter description, terminated with "
+ "single '.' or end of file:\n"
+ "NOTE: This is NOT the log message!\n>> ");
return (description);
}
@@ -553,7 +551,7 @@ checkin_update(struct checkin_params *pb)
pb->newrev = pb->file->rf_head;
/* New head revision has to contain entire file; */
- if (rcs_deltatext_set(pb->file, pb->frev, filec) == -1)
+ if (rcs_deltatext_set(pb->file, pb->frev, filec) == -1)
fatal("failed to set new head revision");
/* Attach a symbolic name to this revision if specified. */
@@ -655,7 +653,7 @@ checkin_init(struct checkin_params *pb)
/* Now add our new revision */
if (rcs_rev_add(pb->file,
(pb->newrev == NULL ? RCS_HEAD_REV : pb->newrev),
- (pb->rcs_msg == NULL ? LOG_INIT : pb->rcs_msg),
+ (pb->rcs_msg == NULL ? "Initial revision" : pb->rcs_msg),
pb->date, pb->author) != 0) {
cvs_log(LP_ERR, "failed to add new revision");
rcs_close(pb->file);
@@ -902,21 +900,21 @@ checkin_keywordscan(char *data, RCSNUM **rev, time_t *date, char **author,
continue;
}
/* look for any matching keywords */
- found = 0;
- for (j = 0; j < 10; j++) {
- if (!strncmp(c, rcs_expkw[j].kw_str,
- strlen(rcs_expkw[j].kw_str))) {
- found = 1;
- kwstr = rcs_expkw[j].kw_str;
- break;
- }
- }
-
- /* unknown keyword, continue looking */
- if (found == 0) {
- c = start;
- continue;
- }
+ found = 0;
+ for (j = 0; j < 10; j++) {
+ if (!strncmp(c, rcs_expkw[j].kw_str,
+ strlen(rcs_expkw[j].kw_str))) {
+ found = 1;
+ kwstr = rcs_expkw[j].kw_str;
+ break;
+ }
+ }
+
+ /* unknown keyword, continue looking */
+ if (found == 0) {
+ c = start;
+ continue;
+ }
c += strlen(kwstr);
if (*c != ':' && *c != '$') {
@@ -933,7 +931,7 @@ checkin_keywordscan(char *data, RCSNUM **rev, time_t *date, char **author,
" too small!");
strlcpy(buf, start, end);
checkin_parsekeyword(buf, rev,
- date, author, state);
+ date, author, state);
break;
}
}
@@ -958,12 +956,12 @@ checkin_keywordscan(char *data, RCSNUM **rev, time_t *date, char **author,
* This enables us to know what data should be in it.
*
* Returns type on success, or -1 on failure.
- */
+ */
static int
checkin_keywordtype(char *keystring)
{
char *p;
-
+
p = keystring;
*p++;
if (strncmp(p, KW_ID, strlen(KW_ID)) == 0)
@@ -994,14 +992,15 @@ checkin_parsekeyword(char *keystring, RCSNUM **rev, time_t *date,
char *tokens[10], *p, *datestring;
size_t len = 0;
int i = 0;
- /* Parse data out of the expanded keyword */
+
+ /* Parse data out of the expanded keyword */
switch (checkin_keywordtype(keystring)) {
case KW_TYPE_ID:
for ((p = strtok(keystring, " ")); p;
- (p = strtok(NULL, " "))) {
+ (p = strtok(NULL, " "))) {
if (i < KW_NUMTOKS_ID - 1)
tokens[i++] = p;
- }
+ }
tokens[i] = NULL;
if (*author != NULL)
xfree(*author);
@@ -1029,10 +1028,10 @@ checkin_parsekeyword(char *keystring, RCSNUM **rev, time_t *date,
break;
case KW_TYPE_AUTHOR:
for ((p = strtok(keystring, " ")); p;
- (p = strtok(NULL, " "))) {
+ (p = strtok(NULL, " "))) {
if (i < KW_NUMTOKS_AUTHOR - 1)
tokens[i++] = p;
- }
+ }
if (*author != NULL)
xfree(*author);
len = strlen(tokens[1]) + 1;
@@ -1041,7 +1040,7 @@ checkin_parsekeyword(char *keystring, RCSNUM **rev, time_t *date,
break;
case KW_TYPE_DATE:
for ((p = strtok(keystring, " ")); p;
- (p = strtok(NULL, " "))) {
+ (p = strtok(NULL, " "))) {
if (i < KW_NUMTOKS_DATE - 1)
tokens[i++] = p;
}
@@ -1056,10 +1055,10 @@ checkin_parsekeyword(char *keystring, RCSNUM **rev, time_t *date,
break;
case KW_TYPE_STATE:
for ((p = strtok(keystring, " ")); p;
- (p = strtok(NULL, " "))) {
+ (p = strtok(NULL, " "))) {
if (i < KW_NUMTOKS_STATE - 1)
tokens[i++] = p;
- }
+ }
if (*state != NULL)
xfree(*state);
len = strlen(tokens[1]) + 1;
@@ -1071,10 +1070,10 @@ checkin_parsekeyword(char *keystring, RCSNUM **rev, time_t *date,
if (*rev != NULL)
break;
for ((p = strtok(keystring, " ")); p;
- (p = strtok(NULL, " "))) {
+ (p = strtok(NULL, " "))) {
if (i < KW_NUMTOKS_REVISION - 1)
tokens[i++] = p;
- }
+ }
if ((*rev = rcsnum_parse(tokens[1])) == NULL)
fatal("could not parse rcsnum");
break;
diff --git a/usr.bin/rcs/co.1 b/usr.bin/rcs/co.1
index 56733bebeae..57c8359e5b6 100644
--- a/usr.bin/rcs/co.1
+++ b/usr.bin/rcs/co.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: co.1,v 1.21 2006/03/05 09:05:56 jmc Exp $
+.\" $OpenBSD: co.1,v 1.22 2006/03/06 09:41:53 deraadt Exp $
.\"
.\" Copyright (c) 2005 Xavier Santolaria <xsa@openbsd.org>
.\" All rights reserved.
diff --git a/usr.bin/rcs/ident.c b/usr.bin/rcs/ident.c
index 34a69bb666b..7a6bab9c52e 100644
--- a/usr.bin/rcs/ident.c
+++ b/usr.bin/rcs/ident.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ident.c,v 1.11 2006/01/20 14:35:02 xsa Exp $ */
+/* $OpenBSD: ident.c,v 1.12 2006/03/06 09:41:53 deraadt Exp $ */
/*
* Copyright (c) 2005 Xavier Santolaria <xsa@openbsd.org>
* All rights reserved.
@@ -96,7 +96,7 @@ ident_file(const char *filename, FILE *fp)
if ((found == 0) && (verbose == 1))
fprintf(stderr, "ident warning: no id keywords in %s\n",
- filename);
+ filename);
found = 0;
diff --git a/usr.bin/rcs/rcsclean.1 b/usr.bin/rcs/rcsclean.1
index ed207c22ae0..ecd00d5ed01 100644
--- a/usr.bin/rcs/rcsclean.1
+++ b/usr.bin/rcs/rcsclean.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: rcsclean.1,v 1.12 2005/11/27 10:55:38 jmc Exp $
+.\" $OpenBSD: rcsclean.1,v 1.13 2006/03/06 09:41:53 deraadt Exp $
.\"
.\" Copyright (c) 2005 Joris Vink <joris@openbsd.org>
.\" All rights reserved.
diff --git a/usr.bin/rcs/rcsdiff.1 b/usr.bin/rcs/rcsdiff.1
index 94a8053f06b..89941cfe7e7 100644
--- a/usr.bin/rcs/rcsdiff.1
+++ b/usr.bin/rcs/rcsdiff.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: rcsdiff.1,v 1.15 2006/02/24 14:15:53 xsa Exp $
+.\" $OpenBSD: rcsdiff.1,v 1.16 2006/03/06 09:41:53 deraadt Exp $
.\"
.\" Copyright (c) 2005 Joris Vink <joris@openbsd.org>
.\" All rights reserved.
diff --git a/usr.bin/rcs/rcsdiff.c b/usr.bin/rcs/rcsdiff.c
index 718ece0e6ab..0a61a0c0810 100644
--- a/usr.bin/rcs/rcsdiff.c
+++ b/usr.bin/rcs/rcsdiff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcsdiff.c,v 1.31 2006/03/05 14:23:07 niallo Exp $ */
+/* $OpenBSD: rcsdiff.c,v 1.32 2006/03/06 09:41:53 deraadt Exp $ */
/*
* Copyright (c) 2005 Joris Vink <joris@openbsd.org>
* All rights reserved.
@@ -289,7 +289,7 @@ rcsdiff_rev(RCSFILE *file, RCSNUM *rev1, RCSNUM *rev2, const char *filename)
if (utimes(path2, (const struct timeval *)&tv2) < 0)
cvs_log(LP_ERRNO, "error setting utimes");
-
+
cvs_diffreg(path1, path2, NULL);
(void)unlink(path1);
(void)unlink(path2);
diff --git a/usr.bin/rcs/rcsintro.7 b/usr.bin/rcs/rcsintro.7
index b9aa4544511..fbccaff75a7 100644
--- a/usr.bin/rcs/rcsintro.7
+++ b/usr.bin/rcs/rcsintro.7
@@ -1,4 +1,4 @@
-.\" $OpenBSD: rcsintro.7,v 1.4 2005/12/01 09:18:54 xsa Exp $
+.\" $OpenBSD: rcsintro.7,v 1.5 2006/03/06 09:41:53 deraadt Exp $
.\"
.\" Copyright (c) 2005 Xavier Santolaria <xsa@openbsd.org>
.\" All rights reserved.
diff --git a/usr.bin/rcs/rcsmerge.1 b/usr.bin/rcs/rcsmerge.1
index 61569dc063e..d89d5c7b398 100644
--- a/usr.bin/rcs/rcsmerge.1
+++ b/usr.bin/rcs/rcsmerge.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: rcsmerge.1,v 1.3 2005/11/22 14:17:45 xsa Exp $
+.\" $OpenBSD: rcsmerge.1,v 1.4 2006/03/06 09:41:53 deraadt Exp $
.\"
.\" Copyright (c) 2005 Xavier Santolaria <xsa@openbsd.org>
.\" All rights reserved.
diff --git a/usr.bin/rcs/rcsprog.c b/usr.bin/rcs/rcsprog.c
index b5ffb9c993e..59063a7d017 100644
--- a/usr.bin/rcs/rcsprog.c
+++ b/usr.bin/rcs/rcsprog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcsprog.c,v 1.63 2006/02/21 16:39:23 niallo Exp $ */
+/* $OpenBSD: rcsprog.c,v 1.64 2006/03/06 09:41:53 deraadt Exp $ */
/*
* Copyright (c) 2005 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -80,7 +80,7 @@ rcs_set_rev(const char *str, RCSNUM **rev)
if ((*rev = rcsnum_parse(str)) == NULL)
fatal("bad revision number '%s'", str);
- /*
+ /*
* If 0 is specified as a revision number, exit and warn the user.
* This differs from GNU ci's plainly buggy behaviour, where 0 ends up
* being 0.1 and other weird stuff.
@@ -91,13 +91,12 @@ rcs_set_rev(const char *str, RCSNUM **rev)
rcsnum_free(t);
/*
* If 1 is specified as revision number, silently assume 1.1.
- * This is what GNU ci does.
+ * This is what GNU ci does.
*/
t = rcsnum_parse(RCS_HEAD_INIT);
if (rcsnum_cmp(*rev, t, 0) > 0)
- rcsnum_cpy(t, *rev, 0);
+ rcsnum_cpy(t, *rev, 0);
rcsnum_free(t);
-
}
/*
diff --git a/usr.bin/rcs/rlog.1 b/usr.bin/rcs/rlog.1
index b4490701a38..5233c8bd1e8 100644
--- a/usr.bin/rcs/rlog.1
+++ b/usr.bin/rcs/rlog.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: rlog.1,v 1.11 2005/12/02 11:13:32 xsa Exp $
+.\" $OpenBSD: rlog.1,v 1.12 2006/03/06 09:41:53 deraadt Exp $
.\"
.\" Copyright (c) 2005 Xavier Santolaria <xsa@openbsd.org>
.\" All rights reserved.