summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/import.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/cvs/import.c')
-rw-r--r--usr.bin/cvs/import.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/usr.bin/cvs/import.c b/usr.bin/cvs/import.c
index 39661d7febf..6e3c6a80c4e 100644
--- a/usr.bin/cvs/import.c
+++ b/usr.bin/cvs/import.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: import.c,v 1.29 2005/11/28 08:49:25 xsa Exp $ */
+/* $OpenBSD: import.c,v 1.30 2005/12/03 01:02:09 joris Exp $ */
/*
* Copyright (c) 2004 Joris Vink <joris@openbsd.org>
* All rights reserved.
@@ -243,6 +243,7 @@ cvs_import_local(CVSFILE *cf, void *arg)
size_t len;
int l;
time_t stamp;
+ char *fcont;
char fpath[MAXPATHLEN], rpath[MAXPATHLEN], repo[MAXPATHLEN];
const char *comment;
struct stat fst;
@@ -250,6 +251,7 @@ cvs_import_local(CVSFILE *cf, void *arg)
struct cvsroot *root;
RCSFILE *rf;
RCSNUM *rev;
+ BUF *bp;
root = CVS_DIR_ROOT(cf);
@@ -367,6 +369,26 @@ cvs_import_local(CVSFILE *cf, void *arg)
return (CVS_EX_DATA);
}
+ if ((bp = cvs_buf_load(fpath, BUF_AUTOEXT)) == NULL) {
+ rcs_close(rf);
+ (void)unlink(rpath);
+ return (CVS_EX_DATA);
+ }
+
+ if (cvs_buf_putc(bp, '\0') < 0) {
+ rcs_close(rf);
+ (void)unlink(rpath);
+ return (CVS_EX_DATA);
+ }
+
+ fcont = cvs_buf_release(bp);
+
+ if (rcs_deltatext_set(rf, rev, fcont) < 0) {
+ rcs_close(rf);
+ (void)unlink(rpath);
+ return (CVS_EX_DATA);
+ }
+
/* add the vendor tag and release tag as symbols */
rcs_close(rf);