diff options
Diffstat (limited to 'contrib/cvs/src/checkin.c')
-rw-r--r-- | contrib/cvs/src/checkin.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/contrib/cvs/src/checkin.c b/contrib/cvs/src/checkin.c index 70fb74c..938b717 100644 --- a/contrib/cvs/src/checkin.c +++ b/contrib/cvs/src/checkin.c @@ -15,15 +15,15 @@ * Returns non-zero on error. */ +#include <assert.h> #include "cvs.h" #include "fileattr.h" #include "edit.h" int -Checkin (type, finfo, rcs, rev, tag, options, message) +Checkin (type, finfo, rev, tag, options, message) int type; struct file_info *finfo; - char *rcs; char *rev; char *tag; char *options; @@ -53,10 +53,15 @@ Checkin (type, finfo, rcs, rev, tag, options, message) } } - if (finfo->rcs == NULL) - finfo->rcs = RCS_parse (finfo->file, finfo->repository); + /* There use to be a check for finfo->rcs == NULL here and then a + * call to RCS_parse when necessary, but Checkin() isn't called + * if the RCS file hasn't already been parsed in one of the + * check functions. + */ + assert (finfo->rcs != NULL); - switch (RCS_checkin (finfo->rcs, NULL, message, rev, RCS_FLAGS_KEEPFILE)) + switch (RCS_checkin (finfo->rcs, finfo->file, message, rev, + RCS_FLAGS_KEEPFILE)) { case 0: /* everything normal */ @@ -78,11 +83,12 @@ Checkin (type, finfo, rcs, rev, tag, options, message) call RCS_checkout here, compare the resulting files using xcmp, and rename if necessary. I think this should be fixed in RCS_cmp_file. */ - if ((! preserve_perms - && options != NULL - && (strcmp (options, "-ko") == 0 - || strcmp (options, "-kb") == 0)) - || RCS_cmp_file (finfo->rcs, rev, options, finfo->file) == 0) + if( ( ! preserve_perms + && options != NULL + && ( strcmp( options, "-ko" ) == 0 + || strcmp( options, "-kb" ) == 0 ) ) + || RCS_cmp_file( finfo->rcs, rev, (char **)NULL, (char *)NULL, + options, finfo->file ) == 0 ) { /* The existing file is correct. We don't have to do anything. */ @@ -176,5 +182,5 @@ Checkin (type, finfo, rcs, rev, tag, options, message) mark_up_to_date (finfo->file); freevers_ts (&vers); - return (0); + return 0; } |