diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2006-04-14 02:45:36 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2006-04-14 02:45:36 +0000 |
commit | e341626ecc5f97ac0da31c1465bb8f0d0a32b0e5 (patch) | |
tree | 0701325a40ac04a02233321c7007dd0aac1a440f /usr.bin/cvs | |
parent | 0e753ff5b41a1e62682b49974035397e8b97edab (diff) |
remove a metric buttload of excessive ()
no binary change; ok ray
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r-- | usr.bin/cvs/add.c | 22 | ||||
-rw-r--r-- | usr.bin/cvs/buf.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/checkout.c | 12 | ||||
-rw-r--r-- | usr.bin/cvs/cmd.c | 26 | ||||
-rw-r--r-- | usr.bin/cvs/commit.c | 12 | ||||
-rw-r--r-- | usr.bin/cvs/compress.c | 14 | ||||
-rw-r--r-- | usr.bin/cvs/cvs.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/diff.c | 48 | ||||
-rw-r--r-- | usr.bin/cvs/entries.c | 26 | ||||
-rw-r--r-- | usr.bin/cvs/file.c | 46 | ||||
-rw-r--r-- | usr.bin/cvs/import.c | 10 | ||||
-rw-r--r-- | usr.bin/cvs/log.c | 6 | ||||
-rw-r--r-- | usr.bin/cvs/logmsg.c | 14 | ||||
-rw-r--r-- | usr.bin/cvs/proto.c | 22 | ||||
-rw-r--r-- | usr.bin/cvs/rcs.c | 58 | ||||
-rw-r--r-- | usr.bin/cvs/rcsnum.c | 16 | ||||
-rw-r--r-- | usr.bin/cvs/remove.c | 8 | ||||
-rw-r--r-- | usr.bin/cvs/req.c | 8 | ||||
-rw-r--r-- | usr.bin/cvs/resp.c | 20 | ||||
-rw-r--r-- | usr.bin/cvs/status.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/tag.c | 8 | ||||
-rw-r--r-- | usr.bin/cvs/update.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/util.c | 34 | ||||
-rw-r--r-- | usr.bin/cvs/version.c | 6 | ||||
-rw-r--r-- | usr.bin/cvs/watch.c | 20 |
25 files changed, 226 insertions, 226 deletions
diff --git a/usr.bin/cvs/add.c b/usr.bin/cvs/add.c index 2ff6947aede..3dc59d5faa1 100644 --- a/usr.bin/cvs/add.c +++ b/usr.bin/cvs/add.c @@ -1,4 +1,4 @@ -/* $OpenBSD: add.c,v 1.40 2006/01/27 12:56:28 xsa Exp $ */ +/* $OpenBSD: add.c,v 1.41 2006/04/14 02:45:35 deraadt Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * Copyright (c) 2005 Xavier Santolaria <xsa@openbsd.org> @@ -137,9 +137,9 @@ cvs_add_local(CVSFILE *cf, void *arg) added = 0; /* dont use `cvs add *' */ - if ((strcmp(cf->cf_name, ".") == 0) || - (strcmp(cf->cf_name, "..") == 0) || - (strcmp(cf->cf_name, CVS_PATH_CVSDIR) == 0)) { + if (strcmp(cf->cf_name, ".") == 0 || + strcmp(cf->cf_name, "..") == 0 || + strcmp(cf->cf_name, CVS_PATH_CVSDIR) == 0) { if (verbosity > 1) fatal("cannot add special file `%s'.", cf->cf_name); } @@ -148,8 +148,8 @@ cvs_add_local(CVSFILE *cf, void *arg) return cvs_add_directory(cf); if ((!(cf->cf_flags & CVS_FILE_ONDISK)) && - (cf->cf_cvstat != CVS_FST_LOST) && - (cf->cf_cvstat != CVS_FST_REMOVED)) { + cf->cf_cvstat != CVS_FST_LOST && + cf->cf_cvstat != CVS_FST_REMOVED) { if (verbosity > 1) cvs_log(LP_WARN, "nothing known about `%s'", cf->cf_name); @@ -170,10 +170,10 @@ cvs_add_local(CVSFILE *cf, void *arg) cf->cf_name, numbuf); return (0); - } else if ((cf->cf_cvstat == CVS_FST_CONFLICT) || - (cf->cf_cvstat == CVS_FST_LOST) || - (cf->cf_cvstat == CVS_FST_MODIFIED) || - (cf->cf_cvstat == CVS_FST_UPTODATE)) { + } else if (cf->cf_cvstat == CVS_FST_CONFLICT || + cf->cf_cvstat == CVS_FST_LOST || + cf->cf_cvstat == CVS_FST_MODIFIED || + cf->cf_cvstat == CVS_FST_UPTODATE) { if (verbosity > 1) { rcsnum_tostr(cf->cf_lrev, numbuf, sizeof(numbuf)); cvs_log(LP_WARN, @@ -244,7 +244,7 @@ cvs_add_directory(CVSFILE *cf) strlcat(rcsdir, repo, sizeof(rcsdir)) >= sizeof(rcsdir)) fatal("cvs_add_directory: path truncation"); - if ((stat(rcsdir, &st) == 0) && !(S_ISDIR(st.st_mode))) + if (stat(rcsdir, &st) == 0 && !(S_ISDIR(st.st_mode))) fatal("%s is not a directory; %s not added: %s", rcsdir, fpath, strerror(errno)); diff --git a/usr.bin/cvs/buf.c b/usr.bin/cvs/buf.c index 3e8dc28f23f..239e25e3552 100644 --- a/usr.bin/cvs/buf.c +++ b/usr.bin/cvs/buf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: buf.c,v 1.48 2006/04/13 19:11:30 joris Exp $ */ +/* $OpenBSD: buf.c,v 1.49 2006/04/14 02:45:35 deraadt Exp $ */ /* * Copyright (c) 2003 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -344,7 +344,7 @@ cvs_buf_write(BUF *b, const char *path, mode_t mode) int fd; open: if ((fd = open(path, O_WRONLY|O_CREAT|O_TRUNC, mode)) == -1) { - if ((errno == EACCES) && (unlink(path) != -1)) + if (errno == EACCES && unlink(path) != -1) goto open; else fatal("open: `%s': %s", path, strerror(errno)); diff --git a/usr.bin/cvs/checkout.c b/usr.bin/cvs/checkout.c index fff1e30859b..f792a6f8d26 100644 --- a/usr.bin/cvs/checkout.c +++ b/usr.bin/cvs/checkout.c @@ -1,4 +1,4 @@ -/* $OpenBSD: checkout.c,v 1.51 2006/03/24 13:34:27 ray Exp $ */ +/* $OpenBSD: checkout.c,v 1.52 2006/04/14 02:45:35 deraadt Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -155,7 +155,7 @@ cvs_checkout_init(struct cvs_cmd *cmd, int argc, char **argv, int *arg) co_mods = argv; co_nmod = argc; - if ((statmod == 0) && (argc == 0)) + if (statmod == 0 && argc == 0) fatal("must specify at least one module or directory"); if (statmod && (argc > 0)) @@ -163,11 +163,11 @@ cvs_checkout_init(struct cvs_cmd *cmd, int argc, char **argv, int *arg) /* `export' command exceptions */ if (cvs_cmdop == CVS_OP_EXPORT) { - if ((tag == NULL) && (date == NULL)) + if (tag == NULL && date == NULL) fatal("must specify a tag or date"); /* we don't want numerical revisions here */ - if ((tag != NULL) && (rcsnum_parse(tag) != NULL)) + if (tag != NULL && rcsnum_parse(tag) != NULL) fatal("tag `%s' must be a symbolic tag", tag); } @@ -190,7 +190,7 @@ cvs_checkout_pre_exec(struct cvsroot *root) if ((sp = strchr(co_mods[i], '/')) != NULL) *sp = '\0'; - if ((mkdir(co_mods[i], 0755) == -1) && (errno != EEXIST)) + if (mkdir(co_mods[i], 0755) == -1 && errno != EEXIST) fatal("cvs_checkout_pre_exec: mkdir `%s': %s", co_mods[i], strerror(errno)); @@ -283,7 +283,7 @@ cvs_checkout_local(CVSFILE *cf, void *arg) static int inattic = 0; /* we don't want these */ - if ((cf->cf_type == DT_DIR) && !strcmp(cf->cf_name, "Attic")) { + if (cf->cf_type == DT_DIR && !strcmp(cf->cf_name, "Attic")) { inattic = 1; return (CVS_EX_OK); } diff --git a/usr.bin/cvs/cmd.c b/usr.bin/cvs/cmd.c index 220ed364257..74dfda1f82b 100644 --- a/usr.bin/cvs/cmd.c +++ b/usr.bin/cvs/cmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd.c,v 1.42 2006/01/02 08:11:56 xsa Exp $ */ +/* $OpenBSD: cmd.c,v 1.43 2006/04/14 02:45:35 deraadt Exp $ */ /* * Copyright (c) 2005 Joris Vink <joris@openbsd.org> * All rights reserved. @@ -175,28 +175,28 @@ cvs_startcmd(struct cvs_cmd *cmd, int argc, char **argv) * these files. */ error = 0; - if ((cmd->cmd_op != CVS_OP_CHECKOUT) && - (cmd->cmd_op != CVS_OP_EXPORT) && - (cmd->cmd_op != CVS_OP_IMPORT) && - (cmd->cmd_op != CVS_OP_INIT) && - (cmd->cmd_op != CVS_OP_RELEASE) && - (cmd->cmd_op != CVS_OP_VERSION)) { + if (cmd->cmd_op != CVS_OP_CHECKOUT && + cmd->cmd_op != CVS_OP_EXPORT && + cmd->cmd_op != CVS_OP_IMPORT && + cmd->cmd_op != CVS_OP_INIT && + cmd->cmd_op != CVS_OP_RELEASE && + cmd->cmd_op != CVS_OP_VERSION) { /* check for the CVS directory */ ret = stat(CVS_PATH_CVSDIR, &st); - if (((ret == -1) && (errno == ENOENT)) || ((ret != -1) && - !(S_ISDIR(st.st_mode)))) + if ((ret == -1 && errno == ENOENT) || + (ret != -1 && !(S_ISDIR(st.st_mode)))) error |= MISSING_CVS_DIR; /* check if the CVS/Entries file exists */ ret = stat(CVS_PATH_ENTRIES, &st); - if (((ret == -1) && (errno == ENOENT)) || ((ret != -1) && - !(S_ISREG(st.st_mode)))) + if ((ret == -1 && errno == ENOENT) || + (ret != -1 && !(S_ISREG(st.st_mode)))) error |= MISSING_CVS_ENTRIES; /* check if the CVS/Repository file exists */ ret = stat(CVS_PATH_REPOSITORY, &st); - if (((ret == -1) && (errno == ENOENT)) || ((ret != -1) && - !(S_ISREG(st.st_mode)))) + if ((ret == -1 && errno == ENOENT) || + (ret != -1 && !(S_ISREG(st.st_mode)))) error |= MISSING_CVS_REPO; } diff --git a/usr.bin/cvs/commit.c b/usr.bin/cvs/commit.c index 757fa80e5ec..52553345a97 100644 --- a/usr.bin/cvs/commit.c +++ b/usr.bin/cvs/commit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: commit.c,v 1.53 2006/04/01 20:11:25 joris Exp $ */ +/* $OpenBSD: commit.c,v 1.54 2006/04/14 02:45:35 deraadt Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -92,7 +92,7 @@ cvs_commit_init(struct cvs_cmd *cmd, int argc, char **argv, int *arg) } } - if ((cvs_msg != NULL) && (mfile != NULL)) { + if (cvs_msg != NULL && mfile != NULL) { cvs_log(LP_ERR, "the -F and -m flags are mutually exclusive"); return (CVS_EX_USAGE); } @@ -201,7 +201,7 @@ cvs_commit_prepare(CVSFILE *cf, void *arg) CVSFILE *copy; struct cvs_flist *clp = (struct cvs_flist *)arg; - if ((cf->cf_type == DT_REG) && (cf->cf_cvstat == wantedstatus)) { + if (cf->cf_type == DT_REG && cf->cf_cvstat == wantedstatus) { copy = cvs_file_copy(cf); if (copy == NULL) return (CVS_EX_DATA); @@ -234,9 +234,9 @@ cvs_commit_remote(CVSFILE *cf, void *arg) cvs_file_getpath(cf, fpath, sizeof(fpath)); - if ((cf->cf_cvstat == CVS_FST_ADDED) || - (cf->cf_cvstat == CVS_FST_MODIFIED) || - (cf->cf_cvstat == CVS_FST_REMOVED)) { + if (cf->cf_cvstat == CVS_FST_ADDED || + cf->cf_cvstat == CVS_FST_MODIFIED || + cf->cf_cvstat == CVS_FST_REMOVED) { cvs_sendentry(root, cf); /* if it's removed, don't bother sending a diff --git a/usr.bin/cvs/compress.c b/usr.bin/cvs/compress.c index c31d6005092..db2f6882163 100644 --- a/usr.bin/cvs/compress.c +++ b/usr.bin/cvs/compress.c @@ -1,4 +1,4 @@ -/* $OpenBSD: compress.c,v 1.3 2006/04/12 13:42:51 xsa Exp $ */ +/* $OpenBSD: compress.c,v 1.4 2006/04/14 02:45:35 deraadt Exp $ */ /* * Copyright (c) 2005 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -51,7 +51,7 @@ cvs_zlib_newctx(int level) { CVSZCTX *ctx; - if ((level < 0) || (level > 9)) + if (level < 0 || level > 9) fatal("invalid compression level %d (must be between 0 and 9)", level); @@ -66,8 +66,8 @@ cvs_zlib_newctx(int level) ctx->z_destrm.zfree = Z_NULL; ctx->z_destrm.opaque = Z_NULL; - if ((inflateInit(&(ctx->z_instrm)) != Z_OK) || - (deflateInit(&(ctx->z_destrm), level) != Z_OK)) + if (inflateInit(&(ctx->z_instrm)) != Z_OK || + deflateInit(&(ctx->z_destrm), level) != Z_OK) fatal("failed to initialize zlib streams"); return (ctx); @@ -115,8 +115,8 @@ cvs_zlib_inflate(CVSZCTX *ctx, BUF *dst, u_char *src, size_t slen) ctx->z_instrm.avail_out = sizeof(buf); ret = inflate(&(ctx->z_instrm), Z_FINISH); - if ((ret == Z_MEM_ERROR) || (ret == Z_BUF_ERROR) || - (ret == Z_STREAM_ERROR) || (ret == Z_DATA_ERROR)) + if (ret == Z_MEM_ERROR || ret == Z_BUF_ERROR || + ret == Z_STREAM_ERROR || ret == Z_DATA_ERROR) fatal("inflate error: %s", ctx->z_instrm.msg); cvs_buf_append(dst, buf, ctx->z_instrm.avail_out); @@ -152,7 +152,7 @@ cvs_zlib_deflate(CVSZCTX *ctx, BUF *dst, u_char *src, size_t slen) ctx->z_destrm.next_out = buf; ctx->z_destrm.avail_out = sizeof(buf); ret = deflate(&(ctx->z_destrm), Z_FINISH); - if ((ret == Z_STREAM_ERROR) || (ret == Z_BUF_ERROR)) + if (ret == Z_STREAM_ERROR || ret == Z_BUF_ERROR) fatal("deflate error: %s", ctx->z_destrm.msg); if (cvs_buf_append(dst, buf, diff --git a/usr.bin/cvs/cvs.c b/usr.bin/cvs/cvs.c index 71c4c40ba4d..a4df675a249 100644 --- a/usr.bin/cvs/cvs.c +++ b/usr.bin/cvs/cvs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cvs.c,v 1.96 2006/04/05 01:38:55 ray Exp $ */ +/* $OpenBSD: cvs.c,v 1.97 2006/04/14 02:45:35 deraadt Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -427,7 +427,7 @@ cvs_var_set(const char *var, const char *val) const char *cp; struct cvs_var *vp; - if ((var == NULL) || (*var == '\0')) { + if (var == NULL || *var == '\0') { cvs_log(LP_ERR, "no variable name"); return (-1); } diff --git a/usr.bin/cvs/diff.c b/usr.bin/cvs/diff.c index c737b1a013f..50cecc3241b 100644 --- a/usr.bin/cvs/diff.c +++ b/usr.bin/cvs/diff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diff.c,v 1.88 2006/04/13 16:55:09 ray Exp $ */ +/* $OpenBSD: diff.c,v 1.89 2006/04/14 02:45:35 deraadt Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. * All rights reserved. @@ -386,10 +386,10 @@ cvs_diff_init(struct cvs_cmd *cmd, int argc, char **argv, int *arg) pflag = 1; break; case 'r': - if ((dap->rev1 == NULL) && (dap->date1 == NULL)) { + if (dap->rev1 == NULL && dap->date1 == NULL) { dap->rev1 = optarg; - } else if ((dap->rev2 == NULL) && - (dap->date2 == NULL)) { + } else if (dap->rev2 == NULL && + dap->date2 == NULL) { dap->rev2 = optarg; } else { cvs_log(LP_ERR, @@ -481,7 +481,7 @@ cvs_diff_remote(struct cvs_file *cfp, void *arg) } else { root = cfp->cf_root; #if 0 - if ((cfp->cf_parent == NULL) || + if (cfp->cf_parent == NULL || (root != cfp->cf_parent->cf_root)) { cvs_connect(root); cvs_diff_pre_exec(root); @@ -705,8 +705,8 @@ cvs_diffreg(const char *file1, const char *file2, BUF *out) rval = D_BINARY; goto closem; } - if ((prepare(0, f1, stb1.st_size) < 0) || - (prepare(1, f2, stb2.st_size) < 0)) { + if (prepare(0, f1, stb1.st_size) < 0 || + prepare(1, f2, stb2.st_size) < 0) { goto closem; } prune(); @@ -779,7 +779,7 @@ files_differ(FILE *f1, FILE *f2) j = fread(buf2, (size_t)1, sizeof(buf2), f2); if (i != j) return (1); - if ((i == 0) && (j == 0)) { + if (i == 0 && j == 0) { if (ferror(f1) || ferror(f2)) return (1); return (0); @@ -883,7 +883,7 @@ isqrt(int n) x = n / x; x += y; x /= 2; - } while ((x - y) > 1 || (x - y) < -1); + } while (x - y > 1 || x - y < -1); return (x); } @@ -1022,7 +1022,7 @@ check(FILE *f1, FILE *f2) ixnew[j] = ctnew += skipline(f2); j++; } - if ((bflag == 1)|| (wflag == 1) || (iflag == 1)) { + if (bflag == 1 || wflag == 1 || iflag == 1) { for (;;) { c = getc(f1); d = getc(f2); @@ -1030,14 +1030,14 @@ check(FILE *f1, FILE *f2) * GNU diff ignores a missing newline * in one file if bflag || wflag. */ - if (((bflag == 1) || (wflag == 1)) && + if ((bflag == 1 || wflag == 1) && ((c == EOF && d == '\n') || (c == '\n' && d == EOF))) { break; } ctold++; ctnew++; - if ((bflag == 1) && isspace(c) && isspace(d)) { + if (bflag == 1 && isspace(c) && isspace(d)) { do { if (c == '\n') break; @@ -1061,13 +1061,13 @@ check(FILE *f1, FILE *f2) if (chrtran[c] != chrtran[d]) { jackpot++; J[i] = 0; - if ((c != '\n') && (c != EOF)) + if (c != '\n' && c != EOF) ctold += skipline(f1); - if ((d != '\n') && (c != EOF)) + if (d != '\n' && c != EOF) ctnew += skipline(f2); break; } - if ((c == '\n') || (c == EOF)) + if (c == '\n' || c == EOF) break; } } else { @@ -1077,13 +1077,13 @@ check(FILE *f1, FILE *f2) if ((c = getc(f1)) != (d = getc(f2))) { /* jackpot++; */ J[i] = 0; - if ((c != '\n') && (c != EOF)) + if (c != '\n' && c != EOF) ctold += skipline(f1); - if ((d != '\n') && (c != EOF)) + if (d != '\n' && c != EOF) ctnew += skipline(f2); break; } - if ((c == '\n') || (c == EOF)) + if (c == '\n' || c == EOF) break; } } @@ -1269,7 +1269,7 @@ change(FILE *f1, FILE *f2, int a, int b, int c, int d) goto proceed; } } - if ((a > b) || (c <= d)) { /* Changes and inserts. */ + if (a > b || c <= d) { /* Changes and inserts. */ for (i = c; i <= d; i++) { line = preadline(fileno(f2), ixnew[i] - ixnew[i - 1], ixnew[i - 1]); @@ -1394,7 +1394,7 @@ fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile) nc = f[i] - f[i - 1]; if (diff_format != D_IFDEF && ch != '\0') { diff_output("%c", ch); - if ((Tflag == 1 ) && (diff_format == D_NORMAL || + if (Tflag == 1 && (diff_format == D_NORMAL || diff_format == D_CONTEXT || diff_format == D_UNIFIED)) diff_output("\t"); @@ -1412,7 +1412,7 @@ fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile) "file"); return; } - if ((c == '\t') && (tflag == 1)) { + if (c == '\t' && tflag == 1) { do { diff_output(" "); } while (++col & 7); @@ -1435,7 +1435,7 @@ readhash(FILE *f) sum = 1; space = 0; - if ((bflag != 1) && (wflag != 1)) { + if (bflag != 1 && wflag != 1) { if (iflag == 1) for (i = 0; (t = getc(f)) != '\n'; i++) { if (t == EOF) { @@ -1462,7 +1462,7 @@ readhash(FILE *f) space++; continue; default: - if ((space != 0) && (wflag != 1)) { + if (space != 0 && wflag != 1) { i++; space = 0; } @@ -1492,7 +1492,7 @@ asciifile(FILE *f) char buf[BUFSIZ]; size_t i, cnt; - if ((aflag == 1) || (f == NULL)) + if (aflag == 1 || f == NULL) return (1); rewind(f); diff --git a/usr.bin/cvs/entries.c b/usr.bin/cvs/entries.c index 7219dc7befd..d3dfe84e5cb 100644 --- a/usr.bin/cvs/entries.c +++ b/usr.bin/cvs/entries.c @@ -1,4 +1,4 @@ -/* $OpenBSD: entries.c,v 1.55 2006/04/05 01:38:55 ray Exp $ */ +/* $OpenBSD: entries.c,v 1.56 2006/04/14 02:45:35 deraadt Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -68,7 +68,7 @@ cvs_ent_open(const char *dir, int flags) if (len >= sizeof(cdpath)) return (NULL); - if ((stat(cdpath, &st) == 0) && S_ISDIR(st.st_mode)) + if (stat(cdpath, &st) == 0 && S_ISDIR(st.st_mode)) nodir = 0; /* the CVS/ directory does exist */ len = cvs_path_cat(dir, CVS_PATH_BACKUPENTRIES, bpath, sizeof(bpath)); @@ -114,9 +114,9 @@ cvs_ent_open(const char *dir, int flags) while (fgets(ebuf, (int)sizeof(ebuf), fp) != NULL) { len = strlen(ebuf); - if ((len > 0) && (ebuf[len - 1] == '\n')) + if (len > 0 && ebuf[len - 1] == '\n') ebuf[--len] = '\0'; - if ((ebuf[0] == 'D') && (ebuf[1] == '\0')) + if (ebuf[0] == 'D' && ebuf[1] == '\0') break; ent = cvs_ent_parse(ebuf); if (ent == NULL) @@ -152,7 +152,7 @@ cvs_ent_open(const char *dir, int flags) if (fp != NULL) { while (fgets(ebuf, (int)sizeof(ebuf), fp) != NULL) { len = strlen(ebuf); - if ((len > 0) && (ebuf[len - 1] == '\n')) + if (len > 0 && ebuf[len - 1] == '\n') ebuf[--len] = '\0'; p = &ebuf[2]; @@ -191,7 +191,7 @@ cvs_ent_close(CVSENTRIES *ep) { struct cvs_ent *ent; - if ((cvs_noexec == 0) && (ep->cef_flags & CVS_ENTF_WR) && + if (cvs_noexec == 0 && (ep->cef_flags & CVS_ENTF_WR) && !(ep->cef_flags & CVS_ENTF_SYNC)) { /* implicit sync with disk */ (void)cvs_ent_write(ep); @@ -372,7 +372,7 @@ cvs_ent_parse(const char *entry) *(dp++) = '\0'; fields[i++] = sp; sp = dp; - } while ((dp != NULL) && (i < CVS_ENTRIES_NFIELDS)); + } while (dp != NULL && i < CVS_ENTRIES_NFIELDS); if (i < CVS_ENTRIES_NFIELDS) { cvs_log(LP_ERR, "missing fields in entry line `%s'", entry); @@ -399,7 +399,7 @@ cvs_ent_parse(const char *entry) sp = fields[2] + 1; } else { sp = fields[2]; - if ((fields[2][0] == '0') && (fields[2][1] == '\0')) + if (fields[2][0] == '0' && fields[2][1] == '\0') ent->ce_status = CVS_ENT_ADDED; } @@ -412,8 +412,8 @@ cvs_ent_parse(const char *entry) if (!strcmp(fields[3], "up to date")) ent->ce_status = CVS_ENT_UPTODATE; } else { - if ((strcmp(fields[3], CVS_DATE_DUMMY) == 0) || - (strncmp(fields[3], "Initial ", 8) == 0)) + if (strcmp(fields[3], CVS_DATE_DUMMY) == 0 || + strncmp(fields[3], "Initial ", 8) == 0) ent->ce_mtime = CVS_DATE_DMSEC; else ent->ce_mtime = cvs_date_parse(fields[3]); @@ -469,8 +469,8 @@ cvs_ent_write(CVSENTRIES *ef) revbuf[0] = '\0'; } else { rcsnum_tostr(ent->ce_rev, revbuf, sizeof(revbuf)); - if ((ent->ce_mtime == CVS_DATE_DMSEC) && - (ent->ce_status != CVS_ENT_ADDED)) + if (ent->ce_mtime == CVS_DATE_DMSEC && + ent->ce_status != CVS_ENT_ADDED) strlcpy(timebuf, CVS_DATE_DUMMY, sizeof(timebuf)); else if (ent->ce_status == CVS_ENT_ADDED) { @@ -479,7 +479,7 @@ cvs_ent_write(CVSENTRIES *ef) } else { ctime_r(&(ent->ce_mtime), timebuf); len = strlen(timebuf); - if ((len > 0) && (timebuf[len - 1] == '\n')) + if (len > 0 && timebuf[len - 1] == '\n') timebuf[--len] = '\0'; } } diff --git a/usr.bin/cvs/file.c b/usr.bin/cvs/file.c index c2248ecdb91..f5b2de74053 100644 --- a/usr.bin/cvs/file.c +++ b/usr.bin/cvs/file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: file.c,v 1.136 2006/04/05 01:38:55 ray Exp $ */ +/* $OpenBSD: file.c,v 1.137 2006/04/14 02:45:35 deraadt Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -253,9 +253,9 @@ cvs_file_create(CVSFILE *parent, const char *path, u_int type, mode_t mode) } cfp->cf_repo = xstrdup(repo); - if (((mkdir(path, mode) == -1) && (errno != EEXIST)) || - (cvs_mkadmin(path, cfp->cf_root->cr_str, cfp->cf_repo, - NULL, NULL, 0) < 0)) { + if ((mkdir(path, mode) == -1 && errno != EEXIST) || + cvs_mkadmin(path, cfp->cf_root->cr_str, cfp->cf_repo, + NULL, NULL, 0) < 0) { cvs_file_free(cfp); return (NULL); } @@ -575,10 +575,10 @@ cvs_file_loadinfo(char *path, int flags, int (*cb)(CVSFILE *, void *), if (cb == NULL) callit = 0; - if ((cvs_cmdop == CVS_OP_SERVER) && (type != DT_DIR)) + if (cvs_cmdop == CVS_OP_SERVER && type != DT_DIR) callit = 0; - if ((root->cr_method == CVS_METHOD_LOCAL) && (type != DT_DIR)) + if (root->cr_method == CVS_METHOD_LOCAL && type != DT_DIR) callit = 0; if (!(base->cf_flags & CVS_FILE_ONDISK)) @@ -593,7 +593,7 @@ cvs_file_loadinfo(char *path, int flags, int (*cb)(CVSFILE *, void *), * If we have a normal file, pass it as well. */ if (type != DT_DIR) { - if ((cb != NULL) && ((cvs_error = cb(cf, arg)) != CVS_EX_OK)) + if (cb != NULL && (cvs_error = cb(cf, arg)) != CVS_EX_OK) goto fail; } else { /* @@ -645,7 +645,7 @@ cvs_file_find(CVSFILE *hier, const char *path) /* special case */ if (*pp == '.') { - if ((*(pp + 1) == '.') && (*(pp + 2) == '\0')) { + if (*(pp + 1) == '.' && *(pp + 2) == '\0') { /* request to go back to parent */ if (cf->cf_parent == NULL) { cvs_log(LP_NOTICE, @@ -747,7 +747,7 @@ cvs_load_dirinfo(CVSFILE *cf, int flags) return (-1); } - if ((stat(pbuf, &st) == 0) && S_ISDIR(st.st_mode)) { + if (stat(pbuf, &st) == 0 && S_ISDIR(st.st_mode)) { if (cvs_readrepo(fpath, pbuf, sizeof(pbuf)) == 0) cf->cf_repo = xstrdup(pbuf); } else { @@ -790,7 +790,7 @@ cvs_file_getdir(CVSFILE *cf, int flags, int (*cb)(CVSFILE *, void *), struct cvs_flist dirs; int nfiles, ndirs; - if ((flags & CF_KNOWN) && (cf->cf_cvstat == CVS_FST_UNKNOWN)) + if ((flags & CF_KNOWN) && cf->cf_cvstat == CVS_FST_UNKNOWN) return (0); /* @@ -847,7 +847,7 @@ cvs_file_getdir(CVSFILE *cf, int flags, int (*cb)(CVSFILE *, void *), continue; } - if ((de->d_type != DT_DIR) && (flags & CF_NOFILES)) + if (de->d_type != DT_DIR && (flags & CF_NOFILES)) continue; cfp = cvs_file_lget(pbuf, flags, cf, entf, ent); @@ -860,7 +860,7 @@ cvs_file_getdir(CVSFILE *cf, int flags, int (*cb)(CVSFILE *, void *), * A file is linked to the parent <cf>, a directory * is added to the dirs SIMPLEQ list for later use. */ - if ((cfp->cf_type != DT_DIR) && !freecf) { + if (cfp->cf_type != DT_DIR && !freecf) { SIMPLEQ_INSERT_TAIL(&(cf->cf_files), cfp, cf_list); nfiles++; } else if (cfp->cf_type == DT_DIR) { @@ -886,7 +886,7 @@ cvs_file_getdir(CVSFILE *cf, int flags, int (*cb)(CVSFILE *, void *), /* * If we don't want to keep it, free it */ - if ((cfp->cf_type != DT_DIR) && freecf) + if (cfp->cf_type != DT_DIR && freecf) cvs_file_free(cfp); } @@ -899,12 +899,12 @@ cvs_file_getdir(CVSFILE *cf, int flags, int (*cb)(CVSFILE *, void *), * * (Follows the same procedure as above ... can we merge them?) */ - while ((entf != NULL) && ((ent = cvs_ent_next(entf)) != NULL)) { + while (entf != NULL && (ent = cvs_ent_next(entf)) != NULL) { if (ent->processed == 1) continue; - if (!(flags & CF_RECURSE) && (ent->ce_type == CVS_ENT_DIR)) + if (!(flags & CF_RECURSE) && ent->ce_type == CVS_ENT_DIR) continue; - if ((flags & CF_NOFILES) && (ent->ce_type != CVS_ENT_DIR)) + if ((flags & CF_NOFILES) && ent->ce_type != CVS_ENT_DIR) continue; len = cvs_path_cat(fpath, ent->ce_name, pbuf, sizeof(pbuf)); @@ -917,7 +917,7 @@ cvs_file_getdir(CVSFILE *cf, int flags, int (*cb)(CVSFILE *, void *), goto done; } - if ((cfp->cf_type != DT_DIR) && !freecf) { + if (cfp->cf_type != DT_DIR && !freecf) { SIMPLEQ_INSERT_TAIL(&(cf->cf_files), cfp, cf_list); nfiles++; } else if (cfp->cf_type == DT_DIR) { @@ -930,7 +930,7 @@ cvs_file_getdir(CVSFILE *cf, int flags, int (*cb)(CVSFILE *, void *), goto done; } - if ((cfp->cf_type != DT_DIR) && freecf) + if (cfp->cf_type != DT_DIR && freecf) cvs_file_free(cfp); } @@ -962,7 +962,7 @@ cvs_file_getdir(CVSFILE *cf, int flags, int (*cb)(CVSFILE *, void *), } if ((cfp->cf_flags & CVS_FILE_ONDISK) && - (cvs_file_getdir(cfp, flags, cb, arg, freecf) < 0)) + cvs_file_getdir(cfp, flags, cb, arg, freecf) < 0) goto done; if (freecf) @@ -972,7 +972,7 @@ cvs_file_getdir(CVSFILE *cf, int flags, int (*cb)(CVSFILE *, void *), ret = 0; cfp = NULL; done: - if ((cfp != NULL) && freecf) + if (cfp != NULL && freecf) cvs_file_free(cfp); while (!SIMPLEQ_EMPTY(&dirs)) { @@ -1146,7 +1146,7 @@ cvs_file_lget(const char *path, int flags, CVSFILE *parent, CVSENTRIES *pent, if (ret == 0) type = IFTODT(st.st_mode); - if ((flags & CF_REPO) && (type != DT_DIR)) { + if ((flags & CF_REPO) && type != DT_DIR) { if ((c = strrchr(path, ',')) == NULL) return (NULL); *c = '\0'; @@ -1157,7 +1157,7 @@ cvs_file_lget(const char *path, int flags, CVSFILE *parent, CVSENTRIES *pent, cfp->cf_parent = parent; cfp->cf_entry = pent; - if ((cfp->cf_type == DT_DIR) && (cfp->cf_parent == NULL)) + if (cfp->cf_type == DT_DIR && cfp->cf_parent == NULL) cfp->cf_flags |= CVS_DIRF_BASE; if (ret == 0) { @@ -1265,7 +1265,7 @@ cvs_file_lget(const char *path, int flags, CVSFILE *parent, CVSENTRIES *pent, xfree(c); } - if ((cfp->cf_repo != NULL) && (cfp->cf_type == DT_DIR) && + if (cfp->cf_repo != NULL && cfp->cf_type == DT_DIR && !strcmp(cfp->cf_repo, path)) cfp->cf_cvstat = CVS_FST_UPTODATE; diff --git a/usr.bin/cvs/import.c b/usr.bin/cvs/import.c index c364eaa5920..5aa7acbf41e 100644 --- a/usr.bin/cvs/import.c +++ b/usr.bin/cvs/import.c @@ -1,4 +1,4 @@ -/* $OpenBSD: import.c,v 1.42 2006/04/05 01:38:55 ray Exp $ */ +/* $OpenBSD: import.c,v 1.43 2006/04/14 02:45:35 deraadt Exp $ */ /* * Copyright (c) 2004 Joris Vink <joris@openbsd.org> * All rights reserved. @@ -105,8 +105,8 @@ cvs_import_init(struct cvs_cmd *cmd, int argc, char **argv, int *arg) if (argc != 3) return (CVS_EX_USAGE); - if ((imp_brnum == NULL) && - ((imp_brnum = rcsnum_parse(CVS_IMPORT_DEFBRANCH)) == NULL)) + if (imp_brnum == NULL && + (imp_brnum = rcsnum_parse(CVS_IMPORT_DEFBRANCH)) == NULL) fatal("cvs_import_init: rcsnum_parse failed"); module = argv[0]; @@ -203,7 +203,7 @@ cvs_import_remote(CVSFILE *cf, void *arg) if (dflag == 1) { ctime_r(&(cf->cf_mtime), date); sz = strlen(date); - if ((sz > 0) && (date[sz - 1] == '\n')) + if (sz > 0 && date[sz - 1] == '\n') date[--sz] = '\0'; cvs_sendreq(root, CVS_REQ_CHECKINTIME, date); } @@ -355,7 +355,7 @@ cvs_import_local(CVSFILE *cf, void *arg) /* add the vendor tag and release tag as symbols */ rcs_close(rf); - if ((dflag ==1) && (utimes(rpath, ts) == -1)) + if (dflag ==1 && utimes(rpath, ts) == -1) cvs_log(LP_ERRNO, "failed to timestamp RCS file"); return (0); diff --git a/usr.bin/cvs/log.c b/usr.bin/cvs/log.c index 266334467d4..3c80790556f 100644 --- a/usr.bin/cvs/log.c +++ b/usr.bin/cvs/log.c @@ -1,4 +1,4 @@ -/* $OpenBSD: log.c,v 1.32 2006/04/13 16:55:09 ray Exp $ */ +/* $OpenBSD: log.c,v 1.33 2006/04/14 02:45:35 deraadt Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -137,7 +137,7 @@ cvs_log_filter(u_int how, u_int level) { u_int i; - if ((level > LP_MAX) && (level != LP_ALL)) { + if (level > LP_MAX && level != LP_ALL) { cvs_log(LP_ERR, "invalid log level for filter"); return (-1); } @@ -239,7 +239,7 @@ cvs_vlog(u_int level, const char *fmt, va_list vap) #endif strlcpy(prefix, __progname, sizeof(prefix)); - if ((cvs_log_flags & LF_PID) && (level != LP_TRACE)) { + if ((cvs_log_flags & LF_PID) && level != LP_TRACE) { snprintf(buf, sizeof(buf), "[%d]", (int)getpid()); strlcat(prefix, buf, sizeof(prefix)); } diff --git a/usr.bin/cvs/logmsg.c b/usr.bin/cvs/logmsg.c index 45dcd3721ce..933ccf9e0c7 100644 --- a/usr.bin/cvs/logmsg.c +++ b/usr.bin/cvs/logmsg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: logmsg.c,v 1.27 2006/01/02 08:11:56 xsa Exp $ */ +/* $OpenBSD: logmsg.c,v 1.28 2006/04/14 02:45:35 deraadt Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -77,8 +77,8 @@ cvs_logmsg_open(const char *path) fatal("cvs_logmsg_open: fgets failed"); len = strlen(lbuf); - if ((len == 0) || (len > 2) || - ((lbuf[0] != 'y') && (lbuf[0] != 'n'))) { + if (len == 0 || len > 2 || + (lbuf[0] != 'y' && lbuf[0] != 'n')) { fprintf(stderr, "invalid input\n"); continue; } else if (lbuf[0] == 'y') @@ -105,8 +105,8 @@ cvs_logmsg_open(const char *path) len = strlen(lbuf); if (len == 0) continue; - else if ((lcont == 0) && (strncmp(lbuf, CVS_LOGMSG_PREFIX, - strlen(CVS_LOGMSG_PREFIX)) == 0)) + else if (lcont == 0 && + strncmp(lbuf, CVS_LOGMSG_PREFIX, strlen(CVS_LOGMSG_PREFIX)) == 0) /* skip lines starting with the prefix */ continue; @@ -245,13 +245,13 @@ cvs_logmsg_get(const char *dir, struct cvs_flist *added, } len = strlen(buf); - if ((len == 0) || (len > 2)) { + if (len == 0 || len > 2) { fprintf(stderr, "invalid input\n"); continue; } else if (buf[0] == 'a') { cvs_log(LP_ABORT, "aborted by user"); break; - } else if ((buf[0] == '\n') || (buf[0] == 'c')) { + } else if (buf[0] == '\n' || buf[0] == 'c') { /* empty message */ msg = xstrdup(""); break; diff --git a/usr.bin/cvs/proto.c b/usr.bin/cvs/proto.c index aeb30a6450c..1134ae0a092 100644 --- a/usr.bin/cvs/proto.c +++ b/usr.bin/cvs/proto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: proto.c,v 1.95 2006/04/11 07:52:34 ray Exp $ */ +/* $OpenBSD: proto.c,v 1.96 2006/04/14 02:45:35 deraadt Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -184,10 +184,10 @@ cvs_connect(struct cvsroot *root) if (root->cr_method == CVS_METHOD_PSERVER) fatal("no pserver support due to security issues"); - else if ((root->cr_method == CVS_METHOD_KSERVER) || - (root->cr_method == CVS_METHOD_GSERVER) || - (root->cr_method == CVS_METHOD_EXT) || - (root->cr_method == CVS_METHOD_FORK)) + else if (root->cr_method == CVS_METHOD_KSERVER || + root->cr_method == CVS_METHOD_GSERVER || + root->cr_method == CVS_METHOD_EXT || + root->cr_method == CVS_METHOD_FORK) fatal("connection method not supported yet"); if (root->cr_flags & CVS_ROOT_CONNECTED) { @@ -208,8 +208,8 @@ cvs_connect(struct cvsroot *root) if (cvs_subproc_pid == -1) { fatal("failed to fork for cvs server connection"); } else if (cvs_subproc_pid == 0) { - if ((dup2(infd[0], STDIN_FILENO) == -1) || - (dup2(outfd[1], STDOUT_FILENO) == -1)) + if (dup2(infd[0], STDIN_FILENO) == -1 || + dup2(outfd[1], STDOUT_FILENO) == -1) fatal("failed to setup standard streams " "for cvs server"); @@ -696,7 +696,7 @@ cvs_getln(struct cvsroot *root, char *lbuf, size_t len) fputs(lbuf, cvs_server_outlog); rlen = strlen(lbuf); - if ((rlen > 0) && (lbuf[rlen - 1] == '\n')) + if (rlen > 0 && lbuf[rlen - 1] == '\n') lbuf[--rlen] = '\0'; } @@ -750,7 +750,7 @@ cvs_sendln(struct cvsroot *root, const char *line) nl = 0; len = strlen(line); - if ((len > 0) && (line[len - 1] != '\n')) + if (len > 0 && line[len - 1] != '\n') nl = 1; if (cvs_server_inlog != NULL) { @@ -867,8 +867,8 @@ cvs_senddir(struct cvsroot *root, CVSFILE *dir) void cvs_sendarg(struct cvsroot *root, const char *arg, int append) { - cvs_sendreq(root, ((append == 0) ? CVS_REQ_ARGUMENT : - CVS_REQ_ARGUMENTX), arg); + cvs_sendreq(root, append == 0 ? CVS_REQ_ARGUMENT : + CVS_REQ_ARGUMENTX, arg); } diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c index 52c50079b93..a401111976e 100644 --- a/usr.bin/cvs/rcs.c +++ b/usr.bin/cvs/rcs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcs.c,v 1.167 2006/04/13 23:41:13 ray Exp $ */ +/* $OpenBSD: rcs.c,v 1.168 2006/04/14 02:45:35 deraadt Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -282,7 +282,7 @@ rcs_open(const char *path, int flags, ...) fmode = S_IRUSR|S_IRGRP|S_IROTH; flags &= 0xffff; /* ditch any internal flags */ - if (((ret = stat(path, &st)) == -1) && (errno == ENOENT)) { + if (((ret = stat(path, &st)) == -1) && errno == ENOENT) { if (flags & RCS_CREATE) { va_start(vap, flags); mode = va_arg(vap, int); @@ -296,7 +296,7 @@ rcs_open(const char *path, int flags, ...) rcs_errno = RCS_ERR_NOENT; return (NULL); } - } else if ((ret == 0) && (flags & RCS_CREATE)) { + } else if (ret == 0 && (flags & RCS_CREATE)) { cvs_log(LP_ERR, "RCS file `%s' exists", path); return (NULL); } @@ -546,8 +546,8 @@ rcs_write(RCSFILE *rfp) if (rename(fn, rfp->rf_path) == -1) { if (errno == EXDEV) { /* rename() not supported so we have to copy. */ - if ((chmod(rfp->rf_path, S_IWUSR) == -1) - && !(rfp->rf_flags & RCS_CREATE)) { + if (chmod(rfp->rf_path, S_IWUSR) == -1 && + !(rfp->rf_flags & RCS_CREATE)) { fatal("chmod(%s, 0%o) failed", rfp->rf_path, S_IWUSR); } @@ -603,7 +603,7 @@ err: if (unlink(rfp->rf_path) == -1) } } - if ((chmod(rfp->rf_path, rfp->rf_mode) == -1)) { + if (chmod(rfp->rf_path, rfp->rf_mode) == -1) { cvs_log(LP_ERRNO, "failed to chmod `%s'", rfp->rf_path); return (-1); @@ -916,8 +916,8 @@ rcs_lock_add(RCSFILE *file, const char *user, RCSNUM *rev) /* first look for duplication */ TAILQ_FOREACH(lkp, &(file->rf_locks), rl_list) { - if ((strcmp(lkp->rl_name, user) == 0) && - (rcsnum_cmp(rev, lkp->rl_num, 0) == 0)) { + if (strcmp(lkp->rl_name, user) == 0 && + rcsnum_cmp(rev, lkp->rl_num, 0) == 0) { rcs_errno = RCS_ERR_DUPENT; return (-1); } @@ -948,8 +948,8 @@ rcs_lock_remove(RCSFILE *file, const char *user, RCSNUM *rev) struct rcs_lock *lkp; TAILQ_FOREACH(lkp, &(file->rf_locks), rl_list) { - if ((strcmp(lkp->rl_name, user) == 0) && - (rcsnum_cmp(lkp->rl_num, rev, 0) == 0)) + if (strcmp(lkp->rl_name, user) == 0 && + rcsnum_cmp(lkp->rl_num, rev, 0) == 0) break; } @@ -1081,12 +1081,12 @@ rcs_patch_lines(struct cvs_lines *dlines, struct cvs_lines *plines) lp = TAILQ_NEXT(lp, l_list)) { op = *(lp->l_line); lineno = (int)strtol((lp->l_line + 1), &ep, 10); - if ((lineno > dlines->l_nblines) || (lineno < 0) || - (*ep != ' ')) + if (lineno > dlines->l_nblines || lineno < 0 || + *ep != ' ') fatal("invalid line specification in RCS patch"); ep++; nbln = (int)strtol(ep, &ep, 10); - if ((nbln < 0) || (*ep != '\0')) + if (nbln < 0 || *ep != '\0') fatal("invalid line number specification in RCS patch"); /* find the appropriate line */ @@ -1099,7 +1099,7 @@ rcs_patch_lines(struct cvs_lines *dlines, struct cvs_lines *plines) dlp = TAILQ_PREV(dlp, cvs_tqh, l_list); } else if (dlp->l_lineno < lineno) { if (((ndlp = TAILQ_NEXT(dlp, l_list)) == NULL) || - (ndlp->l_lineno > lineno)) + ndlp->l_lineno > lineno) break; dlp = ndlp; } @@ -1238,8 +1238,8 @@ rcs_getrev(RCSFILE *rfp, RCSNUM *frev) if (rcsnum_cmp(rfp->rf_head, rev, 0) == 0) break; - if ((isbranch == 1) && (rdp->rd_num->rn_len < rev->rn_len) && - (!TAILQ_EMPTY(&(rdp->rd_branches)))) + if (isbranch == 1 && rdp->rd_num->rn_len < rev->rn_len && + !TAILQ_EMPTY(&(rdp->rd_branches))) lookonbranch = 1; if (isbranch && lookonbranch == 1) { @@ -1285,8 +1285,8 @@ rcs_getrev(RCSFILE *rfp, RCSNUM *frev) break; } while (rcsnum_cmp(crev, rev, 0) != 0); - if (cvs_buf_getc(rbuf, cvs_buf_len(rbuf)-1) != '\n' - && rbuf != NULL) + if (cvs_buf_getc(rbuf, cvs_buf_len(rbuf)-1) != '\n' && + rbuf != NULL) cvs_buf_putc(rbuf, '\n'); return (rbuf); @@ -1417,7 +1417,7 @@ rcs_rev_remove(RCSFILE *rf, RCSNUM *rev) fatal("error getting revision"); } - if ((prevrdp != NULL) && (nextrdp != NULL)) { + if (prevrdp != NULL && nextrdp != NULL) { if ((nextbuf = rcs_getrev(rf, nextrdp->rd_num)) == NULL) fatal("error getting revision"); @@ -1452,7 +1452,7 @@ rcs_rev_remove(RCSFILE *rf, RCSNUM *rev) cvs_diffreg(path_tmp1, path_tmp2, newdiff); newdeltatext = cvs_buf_release(newdiff); - } else if ((nextrdp == NULL) && (prevrdp != NULL)) { + } else if (nextrdp == NULL && prevrdp != NULL) { newdeltatext = cvs_buf_release(prevbuf); } @@ -1464,7 +1464,7 @@ rcs_rev_remove(RCSFILE *rf, RCSNUM *rev) TAILQ_REMOVE(&(rf->rf_delta), rdp, rd_list); /* update pointers */ - if ((prevrdp != NULL) && (nextrdp != NULL)) { + if (prevrdp != NULL && nextrdp != NULL) { rcsnum_cpy(prevrdp->rd_num, nextrdp->rd_next, 0); } else if (prevrdp != NULL) { rcs_head_set(rf, prevrdp->rd_num); @@ -1510,8 +1510,8 @@ rcs_findrev(RCSFILE *rfp, RCSNUM *rev) * is greater than the requested revision. */ rdp = TAILQ_LAST(&(rfp->rf_delta), rcs_dlist); - if ((rdp == NULL) - || (rcsnum_cmp(rdp->rd_num, rev, 0) == -1)) { + if (rdp == NULL || + rcsnum_cmp(rdp->rd_num, rev, 0) == -1) { rcs_parse_deltas(rfp, rev); } @@ -1641,7 +1641,7 @@ rcs_errstr(int code) { const char *esp; - if ((code < 0) || ((code >= (int)RCS_NERR) && (code != RCS_ERR_ERRNO))) + if (code < 0 || (code >= (int)RCS_NERR && code != RCS_ERR_ERRNO)) esp = NULL; else if (code == RCS_ERR_ERRNO) esp = strerror(errno); @@ -1691,8 +1691,8 @@ rcs_parse_deltatexts(RCSFILE *rfp, RCSNUM *rev) int ret; struct rcs_delta *rdp; - if ((rfp->rf_flags & PARSED_DELTATEXTS) - || (rfp->rf_flags & RCS_CREATE)) + if ((rfp->rf_flags & PARSED_DELTATEXTS) || + (rfp->rf_flags & RCS_CREATE)) return; if (!(rfp->rf_flags & PARSED_DESC)) @@ -1806,7 +1806,7 @@ rcs_parse_admin(RCSFILE *rfp) rcs_errno = RCS_ERR_PARSE; cvs_log(LP_ERR, "parse error in RCS admin section"); goto fail; - } else if ((tok == RCS_TOK_NUM) || (tok == RCS_TOK_DESC)) { + } else if (tok == RCS_TOK_NUM || tok == RCS_TOK_DESC) { /* * Assume this is the start of the first delta or * that we are dealing with an empty RCS file and @@ -3022,7 +3022,7 @@ cvs_checkout_rev(RCSFILE *rf, RCSNUM *rev, CVSFILE *cf, char *fpath, content = NULL; oldrev = NULL; - if ((type != CHECKOUT_REV_MERGED) && (type != CHECKOUT_REV_REMOVED)) { + if (type != CHECKOUT_REV_MERGED && type != CHECKOUT_REV_REMOVED) { /* fetch the contents of the revision */ if ((bp = rcs_getrev(rf, rev)) == NULL) { cvs_log(LP_ERR, "revision '%s' not found in file '%s'", @@ -3050,7 +3050,7 @@ cvs_checkout_rev(RCSFILE *rf, RCSNUM *rev, CVSFILE *cf, char *fpath, type == CHECKOUT_REV_UPDATED) { ctime_r(&rcstime, timebuf); l = strlen(timebuf); - if ((l > 0) && (timebuf[l - 1] == '\n')) + if (l > 0 && timebuf[l - 1] == '\n') timebuf[--l] = '\0'; l = snprintf(entry, sizeof(entry), "/%s/%s/%s/%s/", cf->cf_name, diff --git a/usr.bin/cvs/rcsnum.c b/usr.bin/cvs/rcsnum.c index 44ec6a8c7b3..c34fc6f429c 100644 --- a/usr.bin/cvs/rcsnum.c +++ b/usr.bin/cvs/rcsnum.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcsnum.c,v 1.33 2006/04/06 12:12:07 xsa Exp $ */ +/* $OpenBSD: rcsnum.c,v 1.34 2006/04/14 02:45:35 deraadt Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -64,7 +64,7 @@ rcsnum_parse(const char *str) RCSNUM *num; num = rcsnum_alloc(); - if ((rcsnum_aton(str, &ep, num) < 0) || (*ep != '\0')) { + if (rcsnum_aton(str, &ep, num) < 0 || *ep != '\0') { rcsnum_free(num); num = NULL; if (*ep != '\0') @@ -102,7 +102,7 @@ rcsnum_tostr(const RCSNUM *nump, char *buf, size_t blen) u_int i; char tmp[8]; - if ((nump == NULL) || (nump->rn_len == 0)) { + if (nump == NULL || nump->rn_len == 0) { buf[0] = '\0'; return (buf); } @@ -149,7 +149,7 @@ rcsnum_cpy(const RCSNUM *nsrc, RCSNUM *ndst, u_int depth) void *tmp; len = nsrc->rn_len; - if ((depth != 0) && (len > depth)) + if (depth != 0 && len > depth) len = depth; tmp = xrealloc(ndst->rn_id, len, sizeof(len)); @@ -176,7 +176,7 @@ rcsnum_cmp(const RCSNUM *n1, const RCSNUM *n2, u_int depth) size_t slen; slen = MIN(n1->rn_len, n2->rn_len); - if ((depth != 0) && (slen > depth)) + if (depth != 0 && slen > depth) slen = depth; for (i = 0; i < slen; i++) { @@ -268,10 +268,10 @@ rcsnum_aton(const char *str, char **ep, RCSNUM *nump) * */ #if !defined(RCSPROG) - if ((nump->rn_len > 2) && (nump->rn_id[nump->rn_len - 1] == 0) - && (cvs_cmdop != CVS_OP_LOG)) { + if (nump->rn_len > 2 && nump->rn_id[nump->rn_len - 1] == 0 && + cvs_cmdop != CVS_OP_LOG) { #else - if ((nump->rn_len > 2) && (nump->rn_id[nump->rn_len - 1] == 0)) { + if (nump->rn_len > 2 && nump->rn_id[nump->rn_len - 1] == 0) { #endif /* * Look for ".0.x" at the end of the branch number. diff --git a/usr.bin/cvs/remove.c b/usr.bin/cvs/remove.c index c3a9fa5f16d..27c9da23e7a 100644 --- a/usr.bin/cvs/remove.c +++ b/usr.bin/cvs/remove.c @@ -1,4 +1,4 @@ -/* $OpenBSD: remove.c,v 1.43 2006/03/16 09:06:19 xsa Exp $ */ +/* $OpenBSD: remove.c,v 1.44 2006/04/14 02:45:35 deraadt Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * Copyright (c) 2004, 2005 Xavier Santolaria <xsa@openbsd.org> @@ -204,9 +204,9 @@ cvs_remove_local(CVSFILE *cf, void *arg) } if (existing != 0) { - cvs_log(LP_WARN, ((existing == 1) ? + cvs_log(LP_WARN, existing == 1 ? "%d file exists; remove it first" : - "%d files exist; remove them first"), existing); + "%d files exist; remove them first", existing); return (0); } @@ -231,7 +231,7 @@ cvs_remove_file(const char *fpath) return (-1); nuked++; } else { - if ((stat(fpath, &st) == -1) && (errno == ENOENT)) + if (stat(fpath, &st) == -1 && errno == ENOENT) nuked++; } diff --git a/usr.bin/cvs/req.c b/usr.bin/cvs/req.c index 001a81a6fe8..243cf9f3be3 100644 --- a/usr.bin/cvs/req.c +++ b/usr.bin/cvs/req.c @@ -1,4 +1,4 @@ -/* $OpenBSD: req.c,v 1.43 2006/03/28 07:17:17 ray Exp $ */ +/* $OpenBSD: req.c,v 1.44 2006/04/14 02:45:35 deraadt Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -500,7 +500,7 @@ cvs_req_argument(int reqid, char *line) static int cvs_req_globalopt(int reqid, char *line) { - if ((*line != '-') || (*(line + 2) != '\0')) + if (*line != '-' || *(line + 2) != '\0') fatal("invalid `Global_option' request format"); switch (*(line + 1)) { @@ -546,9 +546,9 @@ cvs_req_gzipstream(int reqid, char *line) long val; val = strtol(line, &ep, 10); - if ((line[0] == '\0') || (*ep != '\0')) + if (line[0] == '\0' || *ep != '\0') fatal("invalid Gzip-stream level `%s'", line); - else if ((errno == ERANGE) && ((val < 0) || (val > 9))) + else if (errno == ERANGE && (val < 0 || val > 9)) fatal("Gzip-stream level %ld out of range", val); cvs_compress = (int)val; diff --git a/usr.bin/cvs/resp.c b/usr.bin/cvs/resp.c index e57ad3e5780..0877495406e 100644 --- a/usr.bin/cvs/resp.c +++ b/usr.bin/cvs/resp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: resp.c,v 1.72 2006/03/16 08:43:43 xsa Exp $ */ +/* $OpenBSD: resp.c,v 1.73 2006/04/14 02:45:35 deraadt Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -303,7 +303,7 @@ cvs_resp_error(struct cvsroot *root, int type, char *line) * at the end of the diff command, even for successfull * diff. */ - if ((strlen(line) == 1) && (*line == ' ')) + if (strlen(line) == 1 && *line == ' ') return (1); fprintf(stderr, "%s\n", line); @@ -342,8 +342,8 @@ cvs_resp_statdir(struct cvsroot *root, int type, char *line) } if (cvs_noexec == 0) { - if ((type == CVS_RESP_CLRSTATDIR) && - (cvs_unlink(statpath) == -1)) { + if (type == CVS_RESP_CLRSTATDIR && + cvs_unlink(statpath) == -1) { return (-1); } else if (type == CVS_RESP_SETSTATDIR) { fd = open(statpath, O_CREAT|O_TRUNC|O_WRONLY, 0644); @@ -642,10 +642,10 @@ cvs_resp_updated(struct cvsroot *root, int type, char *line) } else ent->ce_mtime = time(&(ent->ce_mtime)); - if ((type == CVS_RESP_UPDEXIST) || (type == CVS_RESP_UPDATED) || - (type == CVS_RESP_MERGED) || (type == CVS_RESP_CREATED)) { - if ((cvs_ent_remove(cvs_resp_lastent, ent->ce_name, 0) < 0) && - (type != CVS_RESP_CREATED)) { + if (type == CVS_RESP_UPDEXIST || type == CVS_RESP_UPDATED || + type == CVS_RESP_MERGED || type == CVS_RESP_CREATED) { + if (cvs_ent_remove(cvs_resp_lastent, ent->ce_name, 0) < 0 && + type != CVS_RESP_CREATED) { cvs_log(LP_WARN, "failed to remove entry for '%s`", ent->ce_name); } @@ -714,8 +714,8 @@ cvs_resp_removed(struct cvsroot *root, int type, char *line) return (-1); (void)cvs_ent_remove(cvs_resp_lastent, file, 0); - if ((type == CVS_RESP_REMOVED) && ((unlink(fpath) == -1) && - errno != ENOENT)) { + if (type == CVS_RESP_REMOVED && + (unlink(fpath) == -1 && errno != ENOENT)) { cvs_log(LP_ERRNO, "failed to unlink `%s'", file); return (-1); } diff --git a/usr.bin/cvs/status.c b/usr.bin/cvs/status.c index c2d953818e6..b7d5e786b6c 100644 --- a/usr.bin/cvs/status.c +++ b/usr.bin/cvs/status.c @@ -1,4 +1,4 @@ -/* $OpenBSD: status.c,v 1.55 2006/04/12 14:31:05 xsa Exp $ */ +/* $OpenBSD: status.c,v 1.56 2006/04/14 02:45:35 deraadt Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * Copyright (c) 2005 Xavier Santolaria <xsa@openbsd.org> @@ -205,7 +205,7 @@ cvs_status_local(CVSFILE *cf, void *arg) ctime_r(&(cf->cf_etime), timebuf); n = strlen(timebuf); - if ((n > 0) && (timebuf[n - 1] == '\n')) + if (n > 0 && timebuf[n - 1] == '\n') timebuf[--n] = '\0'; strlcat(buf, timebuf, sizeof(buf)); diff --git a/usr.bin/cvs/tag.c b/usr.bin/cvs/tag.c index eea5a554f56..12199a2b513 100644 --- a/usr.bin/cvs/tag.c +++ b/usr.bin/cvs/tag.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tag.c,v 1.42 2006/04/12 14:09:11 xsa Exp $ */ +/* $OpenBSD: tag.c,v 1.43 2006/04/14 02:45:35 deraadt Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * Copyright (c) 2004 Joris Vink <joris@openbsd.org> @@ -146,13 +146,13 @@ cvs_tag_init(struct cvs_cmd *cmd, int argc, char **argv, int *arg) runflags &= ~TAG_BRANCH; } - if ((runflags & TAG_DELETE) && (tag_oldname != NULL)) + if ((runflags & TAG_DELETE) && tag_oldname != NULL) tag_oldname = NULL; - if ((runflags & TAG_DELETE) && (tag_date != NULL)) + if ((runflags & TAG_DELETE) && tag_date != NULL) tag_date = NULL; - if ((tag_oldname != NULL) && (tag_date != NULL)) { + if ((tag_oldname != NULL) && tag_date != NULL) { cvs_log(LP_ERR, "the -D and -r options are mutually exclusive"); return (CVS_EX_USAGE); } diff --git a/usr.bin/cvs/update.c b/usr.bin/cvs/update.c index b9b0ec397e5..064770dcabf 100644 --- a/usr.bin/cvs/update.c +++ b/usr.bin/cvs/update.c @@ -1,4 +1,4 @@ -/* $OpenBSD: update.c,v 1.57 2006/04/10 08:08:00 xsa Exp $ */ +/* $OpenBSD: update.c,v 1.58 2006/04/14 02:45:35 deraadt Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -324,7 +324,7 @@ cvs_update_local(CVSFILE *cf, void *arg) break; } - if ((frev != NULL) && (frev != rf->rf_head)) + if (frev != NULL && frev != rf->rf_head) rcsnum_free(frev); rcs_close(rf); diff --git a/usr.bin/cvs/util.c b/usr.bin/cvs/util.c index 71cf65c2066..6008492c06c 100644 --- a/usr.bin/cvs/util.c +++ b/usr.bin/cvs/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.77 2006/04/05 01:38:56 ray Exp $ */ +/* $OpenBSD: util.c,v 1.78 2006/04/14 02:45:35 deraadt Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * Copyright (c) 2005, 2006 Joris Vink <joris@openbsd.org> @@ -100,7 +100,7 @@ cvs_readrepo(const char *dir, char *dst, size_t len) return (-1); } dlen = strlen(dst); - if ((dlen > 0) && (dst[dlen - 1] == '\n')) + if (dlen > 0 && dst[dlen - 1] == '\n') dst[--dlen] = '\0'; (void)fclose(fp); @@ -145,8 +145,8 @@ cvs_strtomode(const char *str, mode_t *mode) continue; } - if ((type <= 'a') || (type >= 'z') || - (cvs_modetypes[type - 'a'] == -1)) { + if (type <= 'a' || type >= 'z' || + cvs_modetypes[type - 'a'] == -1) { cvs_log(LP_WARN, "invalid mode type `%c'" " (`u', `g' or `o' expected), ignoring", type); @@ -157,8 +157,8 @@ cvs_strtomode(const char *str, mode_t *mode) type = cvs_modetypes[type - 'a']; for (sp = ms; *sp != '\0'; sp++) { - if ((*sp <= 'a') || (*sp >= 'z') || - (cvs_modes[(int)type][*sp - 'a'] == 0)) { + if (*sp <= 'a' || *sp >= 'z' || + cvs_modes[(int)type][*sp - 'a'] == 0) { cvs_log(LP_WARN, "invalid permission bit `%c'", *sp); } else @@ -270,7 +270,7 @@ cvs_splitpath(const char *path, char *base, size_t blen, char **file) if ((rlen = strlcpy(base, path, blen)) >= blen) fatal("cvs_splitpath: path truncation"); - while ((rlen > 0) && (base[rlen - 1] == '/')) + while (rlen > 0 && base[rlen - 1] == '/') base[--rlen] = '\0'; sp = strrchr(base, '/'); @@ -436,7 +436,7 @@ cvs_mkadmin(const char *dpath, const char *rootpath, const char *repopath, if (l >= sizeof(path)) fatal("cvs_mkadmin: path truncation"); - if ((mkdir(path, 0755) == -1) && (errno != EEXIST)) + if (mkdir(path, 0755) == -1 && errno != EEXIST) fatal("cvs_mkadmin: mkdir: `%s': %s", path, strerror(errno)); /* just create an empty Entries file */ @@ -448,7 +448,7 @@ cvs_mkadmin(const char *dpath, const char *rootpath, const char *repopath, if (l >= sizeof(path)) fatal("cvs_mkadmin: path truncation"); - if ((stat(path, &st) == -1) && (errno == ENOENT)) { + if (stat(path, &st) == -1 && errno == ENOENT) { if ((fp = fopen(path, "w")) == NULL) fatal("cvs_mkadmin: fopen: `%s': %s", path, strerror(errno)); @@ -462,7 +462,7 @@ cvs_mkadmin(const char *dpath, const char *rootpath, const char *repopath, if (l >= sizeof(path)) fatal("cvs_mkadmin: path truncation"); - if ((stat(path, &st) == -1) && (errno == ENOENT)) { + if (stat(path, &st) == -1 && errno == ENOENT) { if ((fp = fopen(path, "w")) == NULL) fatal("cvs_mkadmin: fopen: `%s': %s", path, strerror(errno)); @@ -560,7 +560,7 @@ cvs_unlink(const char *path) if (cvs_noexec == 1) return (0); - if ((unlink(path) == -1) && (errno != ENOENT)) { + if (unlink(path) == -1 && errno != ENOENT) { cvs_log(LP_ERRNO, "cannot remove `%s'", path); return (-1); } @@ -605,12 +605,12 @@ cvs_rmdir(const char *path) if (ent->d_type == DT_DIR) { if (cvs_rmdir(fpath) == -1) goto done; - } else if ((cvs_unlink(fpath) == -1) && (errno != ENOENT)) + } else if (cvs_unlink(fpath) == -1 && errno != ENOENT) goto done; } - if ((rmdir(path) == -1) && (errno != ENOENT)) { + if (rmdir(path) == -1 && errno != ENOENT) { cvs_log(LP_ERRNO, "failed to remove '%s'", path); goto done; } @@ -635,7 +635,7 @@ cvs_create_dir(const char *path, int create_adm, char *root, char *repo) CVSENTRIES *entf; struct cvs_ent *ent; - if ((create_adm == 1) && (root == NULL)) + if (create_adm == 1 && root == NULL) fatal("cvs_create_dir failed"); s = xstrdup(path); @@ -654,8 +654,8 @@ cvs_create_dir(const char *path, int create_adm, char *root, char *repo) while (d != NULL) { if (stat(d, &sb)) { /* try to create the directory */ - if ((errno != ENOENT) || (mkdir(d, 0755) && - errno != EEXIST)) { + if (errno != ENOENT || + (mkdir(d, 0755) && errno != EEXIST)) { cvs_log(LP_ERRNO, "failed to create `%s'", d); goto done; } @@ -799,7 +799,7 @@ cvs_write_tagfile(char *tag, char *date, int nb) if (strlcpy(tagpath, CVS_PATH_TAG, sizeof(tagpath)) >= sizeof(tagpath)) return; - if ((tag != NULL) || (date != NULL)) { + if (tag != NULL || date != NULL) { fp = fopen(tagpath, "w+"); if (fp == NULL) { if (errno != ENOENT) diff --git a/usr.bin/cvs/version.c b/usr.bin/cvs/version.c index 0e3fd1609e6..c7ce5bdb4e0 100644 --- a/usr.bin/cvs/version.c +++ b/usr.bin/cvs/version.c @@ -1,4 +1,4 @@ -/* $OpenBSD: version.c,v 1.19 2006/01/02 08:11:56 xsa Exp $ */ +/* $OpenBSD: version.c,v 1.20 2006/04/14 02:45:35 deraadt Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -53,11 +53,11 @@ struct cvs_cmd cvs_cmd_version = { static int cvs_version_pre_exec(struct cvsroot *root) { - if ((root != NULL) && (root->cr_method != CVS_METHOD_LOCAL)) + if (root != NULL && root->cr_method != CVS_METHOD_LOCAL) printf("Client: "); cvs_printf("%s\n", CVS_VERSION); - if ((root != NULL) && (root->cr_method != CVS_METHOD_LOCAL)) { + if (root != NULL && root->cr_method != CVS_METHOD_LOCAL) { cvs_printf("Server: %s\n", root->cr_version == NULL ? "(unknown)" : root->cr_version); } diff --git a/usr.bin/cvs/watch.c b/usr.bin/cvs/watch.c index f2b97ab7a6e..5254a18812c 100644 --- a/usr.bin/cvs/watch.c +++ b/usr.bin/cvs/watch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: watch.c,v 1.11 2006/01/02 08:11:56 xsa Exp $ */ +/* $OpenBSD: watch.c,v 1.12 2006/04/14 02:45:35 deraadt Exp $ */ /* * Copyright (c) 2005 Xavier Santolaria <xsa@openbsd.org> * Copyright (c) 2005 Moritz Jodeit <moritz@openbsd.org> @@ -107,14 +107,14 @@ cvs_watch_init(struct cvs_cmd *cmd, int argc, char **argv, int *arg) * Only `watch add | remove' support the -a option. * Check which command has been issued. */ - if ((watchreq != CVS_REQ_WATCH_ADD) && - (watchreq != CVS_REQ_WATCH_REMOVE)) + if (watchreq != CVS_REQ_WATCH_ADD && + watchreq != CVS_REQ_WATCH_REMOVE) return (CVS_EX_USAGE); - if ((strcmp(optarg, "commit") != 0) && - (strcmp(optarg, "edit") != 0) && - (strcmp(optarg, "unedit") != 0) && - (strcmp(optarg, "all") != 0) && - (strcmp(optarg, "none") != 0)) + if (strcmp(optarg, "commit") != 0 && + strcmp(optarg, "edit") != 0 && + strcmp(optarg, "unedit") != 0 && + strcmp(optarg, "all") != 0 && + strcmp(optarg, "none") != 0) return (CVS_EX_USAGE); aoptstr = xstrdup(optarg); break; @@ -142,8 +142,8 @@ static int cvs_watch_pre_exec(struct cvsroot *root) { if (root->cr_method != CVS_METHOD_LOCAL) { - if ((watchreq != CVS_REQ_WATCH_ADD) && - (watchreq != CVS_REQ_WATCH_REMOVE)) + if (watchreq != CVS_REQ_WATCH_ADD && + watchreq != CVS_REQ_WATCH_REMOVE) return (CVS_EX_OK); if (aoptstr == NULL || strcmp(aoptstr, "all") == 0) { |