diff options
author | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2008-01-28 21:32:01 +0000 |
---|---|---|
committer | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2008-01-28 21:32:01 +0000 |
commit | 9a77627a7d635bc1e064b0735c3c7190b0eacde4 (patch) | |
tree | dbf52857914235b8fd39402aa485bf36a3a9a0d2 | |
parent | 7ddd256f9e4ad13c847aeab5c64fb71f1bf86764 (diff) |
Zapped some variables which made the source harder to read (and to verify).
> Diff from Igor Zinovik
-rw-r--r-- | usr.bin/cvs/commit.c | 16 | ||||
-rw-r--r-- | usr.bin/cvs/cvs.c | 6 |
2 files changed, 10 insertions, 12 deletions
diff --git a/usr.bin/cvs/commit.c b/usr.bin/cvs/commit.c index be36858d079..e40df06cd75 100644 --- a/usr.bin/cvs/commit.c +++ b/usr.bin/cvs/commit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: commit.c,v 1.121 2008/01/28 21:26:51 tobias Exp $ */ +/* $OpenBSD: commit.c,v 1.122 2008/01/28 21:32:00 tobias Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org> @@ -519,17 +519,17 @@ static BUF * commit_diff(struct cvs_file *cf, RCSNUM *rev, int reverse) { char *p1, *p2, *p; - BUF *b1, *b2; + BUF *b; (void)xasprintf(&p1, "%s/diff1.XXXXXXXXXX", cvs_tmpdir); if (cf->file_status == FILE_MODIFIED || cf->file_status == FILE_ADDED) { - if ((b1 = cvs_buf_load_fd(cf->fd, BUF_AUTOEXT)) == NULL) + if ((b = cvs_buf_load_fd(cf->fd, BUF_AUTOEXT)) == NULL) fatal("commit_diff: failed to load '%s'", cf->file_path); - cvs_buf_write_stmp(b1, p1, NULL); - cvs_buf_free(b1); + cvs_buf_write_stmp(b, p1, NULL); + cvs_buf_free(b); } else { rcs_rev_write_stmp(cf->file_rcs, rev, p1, 0); } @@ -537,7 +537,7 @@ commit_diff(struct cvs_file *cf, RCSNUM *rev, int reverse) (void)xasprintf(&p2, "%s/diff2.XXXXXXXXXX", cvs_tmpdir); rcs_rev_write_stmp(cf->file_rcs, rev, p2, RCS_KWEXP_NONE); - if ((b2 = cvs_buf_alloc(128, BUF_AUTOEXT)) == NULL) + if ((b = cvs_buf_alloc(128, BUF_AUTOEXT)) == NULL) fatal("commit_diff: failed to create diff buf"); diff_format = D_RCSDIFF; @@ -548,13 +548,13 @@ commit_diff(struct cvs_file *cf, RCSNUM *rev, int reverse) p2 = p; } - if (cvs_diffreg(p1, p2, b2) == D_ERROR) + if (cvs_diffreg(p1, p2, b) == D_ERROR) fatal("commit_diff: failed to get RCS patch"); xfree(p1); xfree(p2); - return (b2); + return (b); } static void diff --git a/usr.bin/cvs/cvs.c b/usr.bin/cvs/cvs.c index db9458eea48..73dbc1fc916 100644 --- a/usr.bin/cvs/cvs.c +++ b/usr.bin/cvs/cvs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cvs.c,v 1.140 2008/01/10 10:05:40 tobias Exp $ */ +/* $OpenBSD: cvs.c,v 1.141 2008/01/28 21:32:00 tobias Exp $ */ /* * Copyright (c) 2006, 2007 Joris Vink <joris@openbsd.org> * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> @@ -497,7 +497,6 @@ cvs_read_rcfile(void) int cvs_var_set(const char *var, const char *val) { - char *valcp; const char *cp; struct cvs_var *vp; @@ -519,7 +518,6 @@ cvs_var_set(const char *var, const char *val) if (strcmp(vp->cv_name, var) == 0) break; - valcp = xstrdup(val); if (vp == NULL) { vp = xcalloc(1, sizeof(*vp)); @@ -529,7 +527,7 @@ cvs_var_set(const char *var, const char *val) } else /* free the previous value */ xfree(vp->cv_val); - vp->cv_val = valcp; + vp->cv_val = xstrdup(val); return (0); } |