diff options
author | Joris Vink <joris@cvs.openbsd.org> | 2006-05-31 01:26:23 +0000 |
---|---|---|
committer | Joris Vink <joris@cvs.openbsd.org> | 2006-05-31 01:26:23 +0000 |
commit | a17d9ae674be35096bc95ea0be4d7699cffeef27 (patch) | |
tree | 510c7808f8ca51c285f496784a4191cfe18e75b8 /usr.bin/cvs/file.c | |
parent | b7e06e0faad4c8501344e9a3df2dc87691753266 (diff) |
allow commit to ressurect added files that exist in Attic/
Diffstat (limited to 'usr.bin/cvs/file.c')
-rw-r--r-- | usr.bin/cvs/file.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/usr.bin/cvs/file.c b/usr.bin/cvs/file.c index ecb5f5546d9..0c2e90a9450 100644 --- a/usr.bin/cvs/file.c +++ b/usr.bin/cvs/file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: file.c,v 1.154 2006/05/30 22:06:13 joris Exp $ */ +/* $OpenBSD: file.c,v 1.155 2006/05/31 01:26:22 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> @@ -618,18 +618,16 @@ cvs_file_classify(struct cvs_file *cf, const char *tag, int loud) if (cf->file_rcs == NULL) fatal("cvs_file_classify: failed to parse RCS"); cf->file_rcs->rf_inattic = 0; - } else if (cvs_cmdop != CVS_OP_UPDATE && cvs_cmdop != CVS_OP_CHECKOUT - && cvs_cmdop != CVS_OP_COMMIT) { - xfree(cf->file_rpath); + } else if (cvs_cmdop != CVS_OP_CHECKOUT) { l = snprintf(rcsfile, MAXPATHLEN, "%s/%s/%s%s", repo, CVS_PATH_ATTIC, cf->file_name, RCS_FILE_EXT); if (l == -1 || l >= MAXPATHLEN) fatal("cvs_file_classify: overflow"); - cf->file_rpath = xstrdup(rcsfile); - - cf->repo_fd = open(cf->file_rpath, O_RDONLY); + cf->repo_fd = open(rcsfile, O_RDONLY); if (cf->repo_fd != -1) { + xfree(cf->file_rpath); + cf->file_rpath = xstrdup(rcsfile); cf->file_rcs = rcs_open(cf->file_rpath, cf->repo_fd, rflags); if (cf->file_rcs == NULL) |