summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorwiz <wiz@NetBSD.org>2003-01-21 09:43:36 +0000
committerwiz <wiz@NetBSD.org>2003-01-21 09:43:36 +0000
commit786c896ca5685012dfe4ea1a4467d8a053ba8b79 (patch)
tree587a13a9395a834400457f7fc5347edaa909e88f /gnu
parent3cf515684c5ac4392086f3368d3fe0988b7aac7e (diff)
Merge 1.11.5.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/dist/cvs/src/client.c2
-rw-r--r--gnu/dist/cvs/src/commit.c53
-rw-r--r--gnu/dist/cvs/src/rcs.c4
3 files changed, 26 insertions, 33 deletions
diff --git a/gnu/dist/cvs/src/client.c b/gnu/dist/cvs/src/client.c
index 0f849280ed1..5c9f306209d 100644
--- a/gnu/dist/cvs/src/client.c
+++ b/gnu/dist/cvs/src/client.c
@@ -2175,7 +2175,7 @@ update_entries (data_arg, ent_list, short_pathname, filename)
* date. Create a dummy timestamp which will never compare
* equal to the timestamp of the file.
*/
- if (vn[0] == '\0' || vn[0] == '0' || vn[0] == '-')
+ if (vn[0] == '\0' || strcmp (vn, "0") == 0 || vn[0] == '-')
local_timestamp = "dummy timestamp";
else if (local_timestamp == NULL)
{
diff --git a/gnu/dist/cvs/src/commit.c b/gnu/dist/cvs/src/commit.c
index 199a60a0f14..74ef8c6e28d 100644
--- a/gnu/dist/cvs/src/commit.c
+++ b/gnu/dist/cvs/src/commit.c
@@ -248,26 +248,7 @@ find_fileproc (callerdat, finfo)
xfinfo.rcs = NULL;
vers = Version_TS (&xfinfo, NULL, saved_tag, NULL, 0, 0);
- if (vers->ts_user == NULL
- && vers->vn_user != NULL
- && (vers->vn_user[0] == '0' || vers->vn_user[0] == '-'))
- {
- if ( vers->vn_user[0] == '0')
- {
- /* This happens when one has `cvs add'ed a file, but it no
- longer exists in the working directory at commit time. */
- status = T_ADDED;
- }
- else
- {
- /* FIXME: If vn_user is starts with "-" but ts_user is
- non-NULL, what classify_file does is print "%s should be
- removed and is still there". I'm not sure what it does
- then. We probably should do the same. */
- status = T_REMOVED;
- }
- }
- else if (vers->vn_user == NULL)
+ if (vers->vn_user == NULL)
{
if (vers->ts_user == NULL)
error (0, 0, "nothing known about `%s'", finfo->fullname);
@@ -277,16 +258,28 @@ find_fileproc (callerdat, finfo)
freevers_ts (&vers);
return 1;
}
- else if (vers->ts_user != NULL
- && vers->vn_user != NULL
- && vers->vn_user[0] == '0')
- /* FIXME: If vn_user is "0" but ts_user is NULL, what classify_file
- does is print "new-born %s has disappeared" and removes the entry.
- We probably should do the same. No! Not here. Otherwise, a commit
- would succeed in some cases when it should fail. See above. */
+ if (vers->ts_user == NULL)
+ {
+ if (strcmp (vers->vn_user, "0") == 0)
+ /* This happens when one has `cvs add'ed a file, but it no
+ longer exists in the working directory at commit time.
+ FIXME: What classify_file does in this case is print
+ "new-born %s has disappeared" and removes the entry.
+ We probably should do the same. */
+ status = T_ADDED;
+ else if (vers->vn_user[0] == '-')
+ status = T_REMOVED;
+ else
+ {
+ /* FIXME: What classify_file does in this case is print
+ "%s was lost". We probably should do the same. */
+ freevers_ts (&vers);
+ return 0;
+ }
+ }
+ else if (strcmp (vers->vn_user, "0") == 0)
status = T_ADDED;
- else if (vers->ts_user != NULL
- && vers->ts_rcs != NULL
+ else if (vers->ts_rcs != NULL
&& (args->force || strcmp (vers->ts_user, vers->ts_rcs) != 0))
/* If we are forcing commits, pretend that the file is
modified. */
@@ -427,7 +420,7 @@ commit (argc, argv)
/* numeric specified revision means we ignore sticky tags... */
if (saved_tag && isdigit ((unsigned char) *saved_tag))
{
- char *p = saved_tag + strlen (saved_tag);
+ char *p = saved_tag + strlen (saved_tag);
aflag = 1;
/* strip trailing dots and leading zeros */
while (*--p == '.') ;
diff --git a/gnu/dist/cvs/src/rcs.c b/gnu/dist/cvs/src/rcs.c
index 5a4ccbbb199..8347d44cb9a 100644
--- a/gnu/dist/cvs/src/rcs.c
+++ b/gnu/dist/cvs/src/rcs.c
@@ -7541,7 +7541,7 @@ unable to parse %s; `author' not in the expected place", rcsfile);
unable to parse %s; `state' not in the expected place", rcsfile);
vnode->state = rcsbuf_valcopy (rcsbuf, value, 0, (size_t *) NULL);
/* The value is optional, according to rcsfile(5). */
- if (value != NULL && STREQ (value, "dead"))
+ if (value != NULL && STREQ (value, RCSDEAD))
{
vnode->dead = 1;
}
@@ -7627,7 +7627,7 @@ unable to parse %s; `state' not in the expected place", rcsfile);
vnode->dead = 1;
if (vnode->state != NULL)
free (vnode->state);
- vnode->state = xstrdup ("dead");
+ vnode->state = xstrdup (RCSDEAD);
continue;
}
/* if we have a new revision number, we're done with this delta */