diff options
author | 2004-11-26 16:23:50 +0000 | |
---|---|---|
committer | 2004-11-26 16:23:50 +0000 | |
commit | c710bc5ac3ac106f5516424806920d4eebc6fe09 (patch) | |
tree | 4d593a7dee5f316b9cabbee4b403bded2d98e083 /usr.bin/cvs/resp.c | |
parent | Cleanup, document .cvsrc and -f a bit more, and add checkout to the (diff) | |
download | wireguard-openbsd-c710bc5ac3ac106f5516424806920d4eebc6fe09.tar.xz wireguard-openbsd-c710bc5ac3ac106f5516424806920d4eebc6fe09.zip |
Rewrite the internals of the file management code so that we do not keep
a full path to each file we load, and cache file names so we can have
multiple references to a single name. This saves a lot of memory on large
trees such as /usr/src, especially on 'Makefile', 'README' and such.
Diffstat (limited to 'usr.bin/cvs/resp.c')
-rw-r--r-- | usr.bin/cvs/resp.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/cvs/resp.c b/usr.bin/cvs/resp.c index 04afbf4bd4f..3b2662ccdcf 100644 --- a/usr.bin/cvs/resp.c +++ b/usr.bin/cvs/resp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: resp.c,v 1.7 2004/09/23 15:35:10 jfb Exp $ */ +/* $OpenBSD: resp.c,v 1.8 2004/11/26 16:23:50 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -384,7 +384,7 @@ cvs_resp_sticky(struct cvsroot *root, int type, char *line) cf = cvs_file_find(sdir, file); if (cf == NULL) { /* attempt to create it */ - cf = cvs_file_create(line, DT_DIR, 0755); + cf = cvs_file_create(sdir, line, DT_DIR, 0755); if (cf == NULL) return (-1); cf->cf_ddat->cd_repo = strdup(line); @@ -395,7 +395,8 @@ cvs_resp_sticky(struct cvsroot *root, int type, char *line) /* add a directory entry to the parent */ if (CVS_DIR_ENTRIES(sdir) != NULL) { - snprintf(buf, sizeof(buf), "D/%s////", cf->cf_name); + snprintf(buf, sizeof(buf), "D/%s////", + CVS_FILE_NAME(cf)); ent = cvs_ent_parse(buf); if (ent == NULL) cvs_log(LP_ERR, |