diff options
author | 2005-05-24 04:12:25 +0000 | |
---|---|---|
committer | 2005-05-24 04:12:25 +0000 | |
commit | e4276007dfc80452049f621e2fe571403c1cc0b2 (patch) | |
tree | 9690a166970746195780743a210ad5966408f392 /usr.bin/cvs/file.c | |
parent | oops, new arcfour modes here too (diff) | |
download | wireguard-openbsd-e4276007dfc80452049f621e2fe571403c1cc0b2.tar.xz wireguard-openbsd-e4276007dfc80452049f621e2fe571403c1cc0b2.zip |
Merge the cvs_cmd and cvs_cmd_info structures and add the necessary
fields to hook local versions of the commands. This needs to go in
before it gets any bigger
ok joris
Diffstat (limited to 'usr.bin/cvs/file.c')
-rw-r--r-- | usr.bin/cvs/file.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/usr.bin/cvs/file.c b/usr.bin/cvs/file.c index de3cbac2dc5..ae5d78294dd 100644 --- a/usr.bin/cvs/file.c +++ b/usr.bin/cvs/file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: file.c,v 1.76 2005/05/22 17:47:53 joris Exp $ */ +/* $OpenBSD: file.c,v 1.77 2005/05/24 04:12:25 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -503,7 +503,7 @@ char* cvs_file_getpath(CVSFILE *file, char *buf, size_t len) { u_int i; - char *fp, *namevec[CVS_FILE_MAXDEPTH]; + const char *fp, *namevec[CVS_FILE_MAXDEPTH]; CVSFILE *top; buf[0] = '\0'; @@ -657,10 +657,6 @@ cvs_file_getdir(CVSFILE *cf, int flags, char *path, int (*cb)(CVSFILE *, void *) } while ((ent = readdir(dirp)) != NULL) { - if (!strcmp(ent->d_name, ".") || - !strcmp(ent->d_name, "..")) - continue; - if ((flags & CF_IGNORE) && cvs_file_chkign(ent->d_name)) continue; @@ -838,6 +834,8 @@ cvs_file_free(CVSFILE *cf) } else { if (cf->cf_tag != NULL) cvs_strfree(cf->cf_tag); + if (cf->cf_opts != NULL) + cvs_strfree(cf->cf_opts); } free(cf); @@ -1047,11 +1045,21 @@ cvs_file_lget(const char *path, int flags, CVSFILE *parent, struct cvs_ent *ent) cfp->cf_lrev = ent->ce_rev; ent->ce_rev = NULL; - if ((ent->ce_type == CVS_ENT_REG) && - (ent->ce_tag != NULL)) { - if ((cfp->cf_tag = cvs_strdup(ent->ce_tag)) == NULL) { - cvs_file_free(cfp); - return (NULL); + if (ent->ce_type == CVS_ENT_FILE) { + if (ent->ce_tag[0] != '\0') { + cfp->cf_tag = cvs_strdup(ent->ce_tag); + if (cfp->cf_tag == NULL) { + cvs_file_free(cfp); + return (NULL); + } + } + + if (ent->ce_opts[0] != '\0') { + cfp->cf_opts = cvs_strdup(ent->ce_opts); + if (cfp->cf_opts == NULL) { + cvs_file_free(cfp); + return (NULL); + } } } } |