summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/cvs/diff.c8
-rw-r--r--usr.bin/cvs/file.c5
-rw-r--r--usr.bin/cvs/rcs.c6
-rw-r--r--usr.bin/cvs/rcsnum.c4
4 files changed, 9 insertions, 14 deletions
diff --git a/usr.bin/cvs/diff.c b/usr.bin/cvs/diff.c
index 6d5929a6750..83dab55c144 100644
--- a/usr.bin/cvs/diff.c
+++ b/usr.bin/cvs/diff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diff.c,v 1.20 2005/02/01 18:03:32 jfb Exp $ */
+/* $OpenBSD: diff.c,v 1.21 2005/02/25 20:32:48 jfb Exp $ */
/*
* Copyright (C) Caldera International Inc. 2001-2002.
* All rights reserved.
@@ -578,11 +578,10 @@ cvs_diff_file(struct cvs_file *cfp, void *arg)
if (dap->rev1 == NULL)
r1 = entp->ce_rev;
else {
- if ((r1 = rcsnum_alloc()) == NULL) {
+ if ((r1 = rcsnum_parse(dap->rev1)) == NULL) {
cvs_ent_free(entp);
return (-1);
}
- rcsnum_aton(dap->rev1, NULL, r1);
}
cvs_printf("retrieving revision %s\n",
@@ -594,11 +593,10 @@ cvs_diff_file(struct cvs_file *cfp, void *arg)
if (dap->rev2 != NULL) {
cvs_printf("retrieving revision %s\n", dap->rev2);
- if ((r2 = rcsnum_alloc()) == NULL) {
+ if ((r2 = rcsnum_parse(dap->rev2)) == NULL) {
cvs_ent_free(entp);
return (-1);
}
- rcsnum_aton(dap->rev2, NULL, r2);
b2 = rcs_getrev(rf, r2);
rcsnum_free(r2);
} else {
diff --git a/usr.bin/cvs/file.c b/usr.bin/cvs/file.c
index 356c7d6d6ea..007c8d5e9d8 100644
--- a/usr.bin/cvs/file.c
+++ b/usr.bin/cvs/file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.c,v 1.52 2005/01/24 16:41:28 jfb Exp $ */
+/* $OpenBSD: file.c,v 1.53 2005/02/25 20:32:48 jfb Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -148,8 +148,7 @@ cvs_file_init(void)
TAILQ_INIT(&cvs_ign_pats);
- if (((cvs_addedrev = rcsnum_alloc()) == NULL) ||
- (rcsnum_aton("0", NULL, cvs_addedrev) < 0))
+ if ((cvs_addedrev = rcsnum_parse("0")) == NULL)
return (-1);
/* standard patterns to ignore */
diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c
index 53069d2dd28..7531243d10e 100644
--- a/usr.bin/cvs/rcs.c
+++ b/usr.bin/cvs/rcs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcs.c,v 1.24 2005/02/16 19:45:59 jfb Exp $ */
+/* $OpenBSD: rcs.c,v 1.25 2005/02/25 20:32:48 jfb Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -1092,12 +1092,10 @@ rcs_parse_delta(RCSFILE *rfp)
}
if (tok == RCS_TOK_DATE) {
- datenum = rcsnum_alloc();
- if (datenum == NULL) {
+ if ((datenum = rcsnum_parse(tokstr)) == NULL) {
rcs_freedelta(rdp);
return (-1);
}
- rcsnum_aton(tokstr, NULL, datenum);
if (datenum->rn_len != 6) {
cvs_log(LP_ERR,
"RCS date specification has %s "
diff --git a/usr.bin/cvs/rcsnum.c b/usr.bin/cvs/rcsnum.c
index ac7462f2be2..ccbb696ad88 100644
--- a/usr.bin/cvs/rcsnum.c
+++ b/usr.bin/cvs/rcsnum.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcsnum.c,v 1.7 2005/02/25 20:05:42 jfb Exp $ */
+/* $OpenBSD: rcsnum.c,v 1.8 2005/02/25 20:32:48 jfb Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -72,7 +72,7 @@ rcsnum_parse(const char *str)
if ((num = rcsnum_alloc()) == NULL)
return (NULL);
- if (rcsnum_aton(str, &ep, num) < 0) {
+ if ((rcsnum_aton(str, &ep, num) < 0) || (*ep != '\0')) {
rcsnum_free(num);
return (NULL);
}