diff options
author | Xavier Santolaria <xsa@cvs.openbsd.org> | 2008-02-09 20:04:01 +0000 |
---|---|---|
committer | Xavier Santolaria <xsa@cvs.openbsd.org> | 2008-02-09 20:04:01 +0000 |
commit | 8c24de380c7a47ce74567986a655e7fee381faee (patch) | |
tree | 2f0105446f420d2847ad1ae397acd324585ab699 /usr.bin/cvs/util.c | |
parent | 06719c8f8958c753fac5525b73b73c502d342480 (diff) |
Introduce cvs_ent_line_str() - formats CVS/Entries lines.
OK tobias@.
Diffstat (limited to 'usr.bin/cvs/util.c')
-rw-r--r-- | usr.bin/cvs/util.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.bin/cvs/util.c b/usr.bin/cvs/util.c index e8e55bfbe37..dac31a9c9c2 100644 --- a/usr.bin/cvs/util.c +++ b/usr.bin/cvs/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.134 2008/02/09 16:56:58 joris Exp $ */ +/* $OpenBSD: util.c,v 1.135 2008/02/09 20:04:00 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * Copyright (c) 2005, 2006 Joris Vink <joris@openbsd.org> @@ -554,7 +554,7 @@ cvs_mkpath(const char *path, char *tag) CVSENTRIES *ent; FILE *fp; size_t len; - char entry[CVS_ENT_MAXLINELEN], sticky[CVS_REV_BUFSZ]; + char *entry, sticky[CVS_REV_BUFSZ]; char *sp, *dp, *dir, *p, rpath[MAXPATHLEN], repo[MAXPATHLEN]; dir = xstrdup(path); @@ -619,10 +619,16 @@ cvs_mkpath(const char *path, char *tag) if (dp != NULL) { if ((p = strchr(dp, '/')) != NULL) *p = '\0'; + + entry = xmalloc(CVS_ENT_MAXLINELEN); + cvs_ent_line_str(dp, NULL, NULL, NULL, NULL, 1, 0, + entry, CVS_ENT_MAXLINELEN); + ent = cvs_ent_open(rpath); - xsnprintf(entry, sizeof(entry), "D/%s////", dp); cvs_ent_add(ent, entry); cvs_ent_close(ent, ENT_SYNC); + xfree(entry); + if (p != NULL) *p = '/'; } |