diff options
author | Joris Vink <joris@cvs.openbsd.org> | 2005-07-07 20:24:36 +0000 |
---|---|---|
committer | Joris Vink <joris@cvs.openbsd.org> | 2005-07-07 20:24:36 +0000 |
commit | a7b2f27672e9e4eae5d5bc7c18506ee17e9ce94a (patch) | |
tree | 2061a5268d2b308728fc25f4b8f1cfae6e241f4a /usr.bin/cvs | |
parent | 51e82c1e24b906c8913902c4dfc00feb1a1f6af4 (diff) |
do not run the callback for "." twice.
ok xsa@
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r-- | usr.bin/cvs/file.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/usr.bin/cvs/file.c b/usr.bin/cvs/file.c index fb07d1feefc..23f6fc261ac 100644 --- a/usr.bin/cvs/file.c +++ b/usr.bin/cvs/file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: file.c,v 1.94 2005/07/07 19:06:12 joris Exp $ */ +/* $OpenBSD: file.c,v 1.95 2005/07/07 20:24:35 joris Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -436,7 +436,9 @@ cvs_file_getspec(char **fspec, int fsn, int flags, int (*cb)(CVSFILE *, void *), } } - /* XXX - needed for some commands */ + /* + * XXX - needed for some commands + */ if (cb != NULL) { if (cb(base, arg) != CVS_EX_OK) { cvs_file_free(base); @@ -717,8 +719,11 @@ cvs_file_getdir(CVSFILE *cf, int flags, char *path, int (*cb)(CVSFILE *, void *) if ((flags & CF_KNOWN) && (cf->cf_cvstat == CVS_FST_UNKNOWN)) return (0); - /* callback for the directory entry */ - if (cb != NULL) { + /* + * XXX - Do not call the callback for ".", this has + * already been done in cvs_file_getspec(). + */ + if (cb != NULL && strcmp(cf->cf_name, ".")) { if (cb(cf, arg) != CVS_EX_OK) return (-1); } |