diff options
-rw-r--r-- | usr.bin/rcs/ci.c | 44 | ||||
-rw-r--r-- | usr.bin/rcs/co.c | 46 | ||||
-rw-r--r-- | usr.bin/rcs/ident.c | 12 | ||||
-rw-r--r-- | usr.bin/rcs/rcsclean.c | 6 | ||||
-rw-r--r-- | usr.bin/rcs/rcsprog.c | 18 | ||||
-rw-r--r-- | usr.bin/rcs/rlog.c | 30 |
6 files changed, 78 insertions, 78 deletions
diff --git a/usr.bin/rcs/ci.c b/usr.bin/rcs/ci.c index bd6b5cf1b24..791b5bb781a 100644 --- a/usr.bin/rcs/ci.c +++ b/usr.bin/rcs/ci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ci.c,v 1.146 2006/04/14 00:22:46 pat Exp $ */ +/* $OpenBSD: ci.c,v 1.147 2006/04/14 01:11:07 deraadt Exp $ */ /* * Copyright (c) 2005, 2006 Niall O'Higgins <niallo@openbsd.org> * All rights reserved. @@ -298,7 +298,7 @@ checkin_main(int argc, char **argv) rcs_close(pb.file); } - if ((verbose == 1) && (status == 0)) + if (verbose == 1 && status == 0) printf("done\n"); return (status); @@ -484,7 +484,7 @@ checkin_update(struct checkin_params *pb) filec = (char *)cvs_buf_release(bp); /* If this is a zero-ending RCSNUM eg 4.0, increment it (eg to 4.1) */ - if ((pb->newrev != NULL) && (RCSNUM_ZERO_ENDING(pb->newrev))) + if (pb->newrev != NULL && RCSNUM_ZERO_ENDING(pb->newrev)) pb->newrev = rcsnum_inc(pb->newrev); if (checkin_checklock(pb) < 0) @@ -494,8 +494,8 @@ checkin_update(struct checkin_params *pb) * XXX only applies to ci -r1.2 foo for example if HEAD is > 1.2 and * there is no lock set for the user. */ - if ((pb->newrev != NULL) - && (rcsnum_cmp(pb->newrev, pb->frev, 0) > 0)) { + if (pb->newrev != NULL && + rcsnum_cmp(pb->newrev, pb->frev, 0) > 0) { cvs_log(LP_ERR, "%s: revision %s too low; must be higher than %s", pb->file->rf_path, @@ -508,8 +508,8 @@ checkin_update(struct checkin_params *pb) * Set the date of the revision to be the last modification * time of the working file if -d has no argument. */ - if (pb->date == DATE_MTIME - && (checkin_mtimedate(pb) < 0)) + if (pb->date == DATE_MTIME && + (checkin_mtimedate(pb) < 0)) goto fail; /* Date from argv/mtime must be more recent than HEAD */ @@ -586,8 +586,8 @@ checkin_update(struct checkin_params *pb) fatal("failed to set new head revision"); /* Attach a symbolic name to this revision if specified. */ - if (pb->symbol != NULL - && (checkin_attach_symbol(pb) < 0)) + if (pb->symbol != NULL && + (checkin_attach_symbol(pb) < 0)) goto fail; /* Set the state of this revision if specified. */ @@ -610,8 +610,8 @@ checkin_update(struct checkin_params *pb) rcs_write(pb->file); /* Do checkout if -u or -l are specified. */ - if (((pb->flags & CO_LOCK) || (pb->flags & CO_UNLOCK)) - && !(pb->flags & CI_DEFAULT)) + if (((pb->flags & CO_LOCK) || (pb->flags & CO_UNLOCK)) && + !(pb->flags & CI_DEFAULT)) checkout_rev(pb->file, pb->newrev, pb->filename, pb->flags, pb->username, pb->author, NULL, NULL); @@ -644,7 +644,7 @@ checkin_init(struct checkin_params *pb) struct stat st; /* If this is a zero-ending RCSNUM eg 4.0, increment it (eg to 4.1) */ - if ((pb->newrev != NULL) && (RCSNUM_ZERO_ENDING(pb->newrev))) { + if (pb->newrev != NULL && RCSNUM_ZERO_ENDING(pb->newrev)) { pb->frev = rcsnum_alloc(); rcsnum_cpy(pb->newrev, pb->frev, 0); pb->newrev = rcsnum_inc(pb->newrev); @@ -704,8 +704,8 @@ skipdesc: * Set the date of the revision to be the last modification * time of the working file if -d has no argument. */ - if (pb->date == DATE_MTIME - && (checkin_mtimedate(pb) < 0)) + if (pb->date == DATE_MTIME && + (checkin_mtimedate(pb) < 0)) goto fail; /* Now add our new revision */ @@ -734,8 +734,8 @@ skipdesc: } /* Attach a symbolic name to this revision if specified. */ - if (pb->symbol != NULL - && (checkin_attach_symbol(pb) < 0)) + if (pb->symbol != NULL && + (checkin_attach_symbol(pb) < 0)) goto fail; /* Set the state of this revision if specified. */ @@ -756,8 +756,8 @@ skipdesc: rcs_write(pb->file); /* Do checkout if -u or -l are specified. */ - if (((pb->flags & CO_LOCK) || (pb->flags & CO_UNLOCK)) - && !(pb->flags & CI_DEFAULT)) { + if (((pb->flags & CO_LOCK) || (pb->flags & CO_UNLOCK)) && + !(pb->flags & CI_DEFAULT)) { checkout_rev(pb->file, pb->newrev, pb->filename, pb->flags, pb->username, pb->author, NULL, NULL); } @@ -796,8 +796,8 @@ checkin_attach_symbol(struct checkin_params *pb) } } } - if ((ret = rcs_sym_add(pb->file, pb->symbol, pb->newrev) == -1) - && (rcs_errno == RCS_ERR_DUPENT)) { + if ((ret = rcs_sym_add(pb->file, pb->symbol, pb->newrev) == -1) && + (rcs_errno == RCS_ERR_DUPENT)) { rcsnum_tostr(rcs_sym_getrev(pb->file, pb->symbol), rbuf, sizeof(rbuf)); cvs_log(LP_ERR, @@ -851,8 +851,8 @@ checkin_checklock(struct checkin_params *pb) struct rcs_lock *lkp; TAILQ_FOREACH(lkp, &(pb->file->rf_locks), rl_list) { - if ((!strcmp(lkp->rl_name, pb->username)) && - (!rcsnum_cmp(lkp->rl_num, pb->frev, 0))) + if (!strcmp(lkp->rl_name, pb->username) && + !rcsnum_cmp(lkp->rl_num, pb->frev, 0)) return (0); } diff --git a/usr.bin/rcs/co.c b/usr.bin/rcs/co.c index 05b8d62af6a..ac48c2a35ee 100644 --- a/usr.bin/rcs/co.c +++ b/usr.bin/rcs/co.c @@ -1,4 +1,4 @@ -/* $OpenBSD: co.c,v 1.76 2006/04/13 03:18:06 joris Exp $ */ +/* $OpenBSD: co.c,v 1.77 2006/04/14 01:11:07 deraadt Exp $ */ /* * Copyright (c) 2005 Joris Vink <joris@openbsd.org> * All rights reserved. @@ -208,7 +208,7 @@ checkout_main(int argc, char **argv) rcs_set_mtime(fpath, rcs_mtime); } - if ((rev != RCS_HEAD_REV) && (frev != NULL)) + if (rev != RCS_HEAD_REV && frev != NULL) rcsnum_free(frev); return (status); @@ -280,7 +280,7 @@ checkout_rev(RCSFILE *file, RCSNUM *frev, const char *dst, int flags, * If we cannot find one, we return an error. */ rdp = NULL; - if ((file->rf_ndelta != 0) && (frev == file->rf_head)) { + if (file->rf_ndelta != 0 && frev == file->rf_head) { if (lcount > 1) { cvs_log(LP_WARN, "multiple revisions locked by %s; " @@ -296,12 +296,12 @@ checkout_rev(RCSFILE *file, RCSNUM *frev, const char *dst, int flags, continue; } - if ((author != NULL) && - (strcmp(rdp->rd_author, author))) + if (author != NULL && + strcmp(rdp->rd_author, author)) continue; - if ((state != NULL) && - (strcmp(rdp->rd_state, state))) + if (state != NULL && + strcmp(rdp->rd_state, state)) continue; frev = rdp->rd_num; @@ -311,7 +311,7 @@ checkout_rev(RCSFILE *file, RCSNUM *frev, const char *dst, int flags, rdp = rcs_findrev(file, frev); } - if ((file->rf_ndelta != 0) && (rdp == NULL)) { + if (file->rf_ndelta != 0 && rdp == NULL) { checkout_err_nobranch(file, author, date, state, flags); return (-1); } @@ -323,7 +323,7 @@ checkout_rev(RCSFILE *file, RCSNUM *frev, const char *dst, int flags, rcsnum_tostr(rev, buf, sizeof(buf)); - if ((file->rf_ndelta != 0) && (rdp->rd_locker != NULL)) { + if (file->rf_ndelta != 0 && rdp->rd_locker != NULL) { if (strcmp(lockname, rdp->rd_locker)) { strlcpy(msg, "Revision %s is already locked by %s; ", sizeof(msg)); @@ -338,11 +338,11 @@ checkout_rev(RCSFILE *file, RCSNUM *frev, const char *dst, int flags, } } - if ((verbose == 1) && !(flags & NEWFILE) && - !(flags & CO_REVERT) && (file->rf_ndelta != 0)) + if (verbose == 1 && !(flags & NEWFILE) && + !(flags & CO_REVERT) && file->rf_ndelta != 0) printf("revision %s", buf); - if ((verbose == 1) && (flags & CO_REVERT)) + if (verbose == 1 && (flags & CO_REVERT)) printf("done"); if (file->rf_ndelta != 0) { @@ -370,8 +370,8 @@ checkout_rev(RCSFILE *file, RCSNUM *frev, const char *dst, int flags, if (flags & CO_LOCK) { if (file->rf_ndelta != 0) { - if ((lockname != NULL) - && (rcs_lock_add(file, lockname, rev) < 0)) { + if (lockname != NULL && + rcs_lock_add(file, lockname, rev) < 0) { if (rcs_errno != RCS_ERR_DUPENT) return (-1); } @@ -383,8 +383,8 @@ checkout_rev(RCSFILE *file, RCSNUM *frev, const char *dst, int flags, mode |= S_IWUSR; if (file->rf_ndelta != 0) { - if ((verbose == 1) && !(flags & NEWFILE) - && !(flags & CO_REVERT)) + if (verbose == 1 && !(flags & NEWFILE) && + !(flags & CO_REVERT)) printf(" (locked)"); } } else if (flags & CO_UNLOCK) { @@ -400,30 +400,30 @@ checkout_rev(RCSFILE *file, RCSNUM *frev, const char *dst, int flags, (S_IXUSR|S_IXGRP|S_IXOTH|S_IRUSR|S_IRGRP|S_IROTH); if (file->rf_ndelta != 0) { - if ((verbose == 1) && !(flags & NEWFILE) - && !(flags & CO_REVERT)) + if (verbose == 1 && !(flags & NEWFILE) && + !(flags & CO_REVERT)) printf(" (unlocked)"); } } - if ((file->rf_ndelta == 0) && + if (file->rf_ndelta == 0 && ((flags & CO_LOCK) || (flags & CO_UNLOCK))) { cvs_log(LP_WARN, "no revisions, so nothing can be %s", (flags & CO_LOCK) ? "locked" : "unlocked"); } else if (file->rf_ndelta != 0) { - if ((verbose == 1) && !(flags & NEWFILE)) + if (verbose == 1 && !(flags & NEWFILE)) printf("\n"); } if (flags & CO_LOCK) { if (rcs_errno != RCS_ERR_DUPENT) lcount++; - if ((verbose == 1) && (lcount > 1) && !(flags & CO_REVERT)) + if (verbose == 1 && lcount > 1 && !(flags & CO_REVERT)) cvs_log(LP_WARN, "%s: warning: You now have %d locks.", file->rf_path, lcount); } - if ((pipeout == 0) && (stat(dst, &st) == 0) && !(flags & FORCE)) { + if (pipeout == 0 && stat(dst, &st) == 0 && !(flags & FORCE)) { /* * XXX - Not sure what is "right". If we go according * to GNU's behavior, an existing file with no writable @@ -444,7 +444,7 @@ checkout_rev(RCSFILE *file, RCSNUM *frev, const char *dst, int flags, printf("remove it? [ny](n): "); /* default is n */ if (cvs_yesno() == -1) { - if ((verbose == 1) && isatty(STDIN_FILENO)) + if (verbose == 1 && isatty(STDIN_FILENO)) cvs_log(LP_ERR, "writable %s exists; checkout aborted", dst); diff --git a/usr.bin/rcs/ident.c b/usr.bin/rcs/ident.c index c1248b16987..cc66501ca38 100644 --- a/usr.bin/rcs/ident.c +++ b/usr.bin/rcs/ident.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ident.c,v 1.14 2006/03/22 17:04:52 xsa Exp $ */ +/* $OpenBSD: ident.c,v 1.15 2006/04/14 01:11:07 deraadt Exp $ */ /* * Copyright (c) 2005 Xavier Santolaria <xsa@openbsd.org> * All rights reserved. @@ -88,14 +88,14 @@ ident_file(const char *filename, FILE *fp) else filename = "standard output"; - for (c = 0; c != EOF; (c = getc(fp))) { - if ((feof(fp)) || (ferror(fp))) + for (c = 0; c != EOF; c = getc(fp)) { + if (feof(fp) || ferror(fp)) break; if (c == KEYDELIM) ident_line(fp); } - if ((found == 0) && (verbose == 1)) + if (found == 0 && verbose == 1) fprintf(stderr, "ident warning: no id keywords in %s\n", filename); @@ -111,7 +111,7 @@ ident_line(FILE *fp) p = linebuf; while ((c = getc(fp)) != VALDELIM) { - if ((c == EOF) && (feof(fp) | ferror(fp))) + if (c == EOF && (feof(fp) | ferror(fp))) return; if (isalpha(c)) @@ -123,7 +123,7 @@ ident_line(FILE *fp) *(p++) = VALDELIM; while ((c = getc(fp)) != KEYDELIM) { - if ((c == EOF) && (feof(fp) | ferror(fp))) + if (c == EOF && (feof(fp) | ferror(fp))) return; if (c == '\n') diff --git a/usr.bin/rcs/rcsclean.c b/usr.bin/rcs/rcsclean.c index b54de6bc60b..2326d61dec3 100644 --- a/usr.bin/rcs/rcsclean.c +++ b/usr.bin/rcs/rcsclean.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcsclean.c,v 1.32 2006/04/13 16:23:31 ray Exp $ */ +/* $OpenBSD: rcsclean.c,v 1.33 2006/04/14 01:11:07 deraadt Exp $ */ /* * Copyright (c) 2005 Joris Vink <joris@openbsd.org> * All rights reserved. @@ -187,8 +187,8 @@ rcsclean_file(char *fname, const char *rev_str) xfree(c2); if (match == 1) { - if ((uflag == 1) && (!TAILQ_EMPTY(&(file->rf_locks)))) { - if ((verbose == 1) && (nflag == 0)) { + if (uflag == 1 && !TAILQ_EMPTY(&(file->rf_locks))) { + if (verbose == 1 && nflag == 0) { printf("rcs -u%s %s\n", rcsnum_tostr(rev, numb, sizeof(numb)), fpath); diff --git a/usr.bin/rcs/rcsprog.c b/usr.bin/rcs/rcsprog.c index 37d4b05a9e7..f4bf4a40a75 100644 --- a/usr.bin/rcs/rcsprog.c +++ b/usr.bin/rcs/rcsprog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcsprog.c,v 1.101 2006/04/13 19:55:41 joris Exp $ */ +/* $OpenBSD: rcsprog.c,v 1.102 2006/04/14 01:11:07 deraadt Exp $ */ /* * Copyright (c) 2005 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -256,7 +256,7 @@ rcs_choosefile(const char *filename) if (strlcpy(rcsdir, rcspath, sizeof(rcsdir)) >= sizeof(rcsdir) || strlcat(rcsdir, RCSDIR, sizeof(rcsdir)) >= sizeof(rcsdir)) return (NULL); - if ((stat(rcsdir, &sb) == 0) && (sb.st_mode & S_IFDIR)) + if (stat(rcsdir, &sb) == 0 && (sb.st_mode & S_IFDIR)) if (strlcpy(rcspath, rcsdir, sizeof(rcspath)) >= sizeof(rcspath) || strlcat(rcspath, "/", sizeof(rcspath)) >= sizeof(rcspath)) return (NULL); @@ -344,8 +344,8 @@ rcs_statfile(char *fname, char *out, size_t len) /* Error out if file not found and we are not creating one. */ if (stat(rcspath, &st) == -1 && !(flags & RCS_CREATE)) { - if ((strcmp(__progname, "rcsclean") != 0) - && (strcmp(__progname, "ci") != 0)) + if (strcmp(__progname, "rcsclean") != 0 && + strcmp(__progname, "ci") != 0) cvs_log(LP_ERRNO, "%s", rcspath); xfree(rcspath); return (-1); @@ -821,7 +821,7 @@ rcs_attach_symbol(RCSFILE *file, const char *symname) if (rm == 1) { if (rcs_sym_remove(file, symname) < 0) { - if ((rcs_errno == RCS_ERR_NOENT) && + if (rcs_errno == RCS_ERR_NOENT && !(rcsflags & RCSPROG_NFLAG)) cvs_log(LP_WARN, "can't delete nonexisting symbol %s", symname); @@ -832,8 +832,8 @@ rcs_attach_symbol(RCSFILE *file, const char *symname) } if (rm == 0) { - if ((rcs_sym_add(file, symname, rev) < 0) && - (rcs_errno == RCS_ERR_DUPENT)) { + if (rcs_sym_add(file, symname, rev) < 0 && + rcs_errno == RCS_ERR_DUPENT) { rcsnum_tostr(rcs_sym_getrev(file, symname), rbuf, sizeof(rbuf)); fatal("symbolic name %s already bound to %s", @@ -953,8 +953,8 @@ rcs_rev_select(RCSFILE *file, char *range) cvs_argv_destroy(revrange); TAILQ_FOREACH(rdp, &file->rf_delta, rd_list) - if ((rcsnum_cmp(rdp->rd_num, &lnum, 0) <= 0) && - (rcsnum_cmp(rdp->rd_num, &rnum, 0) >= 0) && + if (rcsnum_cmp(rdp->rd_num, &lnum, 0) <= 0 && + rcsnum_cmp(rdp->rd_num, &rnum, 0) >= 0 && !(rdp->rd_flags & RCS_RD_SELECT)) { rdp->rd_flags |= RCS_RD_SELECT; nrev++; diff --git a/usr.bin/rcs/rlog.c b/usr.bin/rcs/rlog.c index bebb3bd1e0b..070cc7f92ee 100644 --- a/usr.bin/rcs/rlog.c +++ b/usr.bin/rcs/rlog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rlog.c,v 1.40 2006/04/13 19:16:15 joris Exp $ */ +/* $OpenBSD: rlog.c,v 1.41 2006/04/14 01:11:07 deraadt Exp $ */ /* * Copyright (c) 2005 Joris Vink <joris@openbsd.org> * Copyright (c) 2005, 2006 Xavier Santolaria <xsa@openbsd.org> @@ -129,7 +129,7 @@ rlog_main(int argc, char **argv) exit(1); } - if ((hflag == 1) && (tflag == 1)) { + if (hflag == 1 && tflag == 1) { cvs_log(LP_WARN, "warning: -t overrides -h."); hflag = 0; } @@ -141,7 +141,7 @@ rlog_main(int argc, char **argv) if ((file = rcs_open(fpath, RCS_READ|RCS_PARSE_FULLY)) == NULL) continue; - if ((Lflag == 1) && (TAILQ_EMPTY(&(file->rf_locks)))) { + if (Lflag == 1 && TAILQ_EMPTY(&(file->rf_locks))) { rcs_close(file); continue; } @@ -208,22 +208,22 @@ rlog_file(const char *fname, const char *fpath) printf("total revisions: %u", file->rf_ndelta); - if ((file->rf_head != NULL) && (hflag == 0) && (tflag == 0)) + if (file->rf_head != NULL && hflag == 0 && tflag == 0) printf(";\tselected revisions: %u", nrev); printf("\n"); - if ((hflag == 0) || (tflag == 1)) + if (hflag == 0 || tflag == 1) printf("description:\n%s", file->rf_desc); - if ((hflag == 0) && (tflag == 0)) { + if (hflag == 0 && tflag == 0) { TAILQ_FOREACH(rdp, &(file->rf_delta), rd_list) { /* * if selections are enabled verify that entry is * selected. */ - if ((rflag == 0) || (rdp->rd_flags & RCS_RD_SELECT)) + if (rflag == 0 || (rdp->rd_flags & RCS_RD_SELECT)) rlog_rev_print(rdp); } } @@ -304,11 +304,11 @@ rlog_rev_print(struct rcs_delta *rdp) } /* XXX dirty... */ - if (((((slist != NULL) && (wflag == 1)) || - ((slist != NULL) && (lflag == 1)) || - ((lflag == 1) && (wflag == 1))) && (found < 2)) || - ((((slist != NULL) && (lflag == 1) && (wflag == 1)) || - ((slist != NULL) || (lflag == 1) || (wflag == 1))) && (found == 0))) + if ((((slist != NULL && wflag == 1) || + (slist != NULL && lflag == 1) || + (lflag == 1 && wflag == 1)) && found < 2) || + (((slist != NULL && lflag == 1 && wflag == 1) || + (slist != NULL || lflag == 1 || wflag == 1)) && found == 0)) return; printf("%s\n", REVSEP); @@ -330,7 +330,7 @@ rlog_rev_print(struct rcs_delta *rdp) strftime(timeb, sizeof(timeb), fmt, &t); printf("\ndate: %s; author: %s; state: %s;\n", timeb, rdp->rd_author, - rdp->rd_state); + rdp->rd_state); printf("%s", rdp->rd_log); } @@ -393,8 +393,8 @@ rlog_rev_select(void) cvs_argv_destroy(revrange); TAILQ_FOREACH(rdp, &file->rf_delta, rd_list) - if ((rcsnum_cmp(rdp->rd_num, &lnum, 0) <= 0) && - (rcsnum_cmp(rdp->rd_num, &rnum, 0) >= 0) && + if (rcsnum_cmp(rdp->rd_num, &lnum, 0) <= 0 && + rcsnum_cmp(rdp->rd_num, &rnum, 0) >= 0 && !(rdp->rd_flags & RCS_RD_SELECT)) { rdp->rd_flags |= RCS_RD_SELECT; nrev++; |