=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/file.c,v retrieving revision 1.116 retrieving revision 1.117 diff -c -r1.116 -r1.117 *** src/usr.bin/cvs/file.c 2005/08/19 13:36:50 1.116 --- src/usr.bin/cvs/file.c 2005/09/06 15:29:33 1.117 *************** *** 1,4 **** ! /* $OpenBSD: file.c,v 1.116 2005/08/19 13:36:50 joris Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. --- 1,4 ---- ! /* $OpenBSD: file.c,v 1.117 2005/09/06 15:29:33 joris Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. *************** *** 837,842 **** --- 837,851 ---- !strcmp(de->d_name, "..")) continue; + len = cvs_path_cat(fpath, de->d_name, pbuf, sizeof(pbuf)); + if (len >= sizeof(pbuf)) + goto done; + + if (entf != NULL) + ent = cvs_ent_get(entf, de->d_name); + else + ent = NULL; + /* * Do some filtering on the current directory item. */ *************** *** 844,869 **** continue; if (!(flags & CF_RECURSE) && (de->d_type == DT_DIR)) { ! if (entf != NULL) ! (void)cvs_ent_remove(entf, de->d_name); continue; } if ((de->d_type != DT_DIR) && (flags & CF_NOFILES)) continue; - /* - * Obtain info about the item. - */ - len = cvs_path_cat(fpath, de->d_name, pbuf, sizeof(pbuf)); - if (len >= sizeof(pbuf)) - goto done; - - if (entf != NULL) - ent = cvs_ent_get(entf, de->d_name); - else - ent = NULL; - cfp = cvs_file_lget(pbuf, flags, cf, entf, ent); if (cfp == NULL) { cvs_log(LP_ERR, "failed to get '%s'", pbuf); --- 853,866 ---- continue; if (!(flags & CF_RECURSE) && (de->d_type == DT_DIR)) { ! if (ent != NULL) ! ent->processed = 1; continue; } if ((de->d_type != DT_DIR) && (flags & CF_NOFILES)) continue; cfp = cvs_file_lget(pbuf, flags, cf, entf, ent); if (cfp == NULL) { cvs_log(LP_ERR, "failed to get '%s'", pbuf); *************** *** 892,902 **** } /* ! * Remove it from the Entries list to make sure it won't ! * be picked up again when we look at the Entries. */ ! if (entf != NULL) ! (void)cvs_ent_remove(entf, de->d_name); /* * If we don't want to keep it, free it --- 889,898 ---- } /* ! * Mark the entry as processed. */ ! if (ent != NULL) ! ent->processed = 1; /* * If we don't want to keep it, free it *************** *** 915,920 **** --- 911,918 ---- * (Follows the same procedure as above ... can we merge them?) */ while ((entf != NULL) && ((ent = cvs_ent_next(entf)) != NULL)) { + if (ent->processed == 1) + continue; if (!(flags & CF_RECURSE) && (ent->ce_type == CVS_ENT_DIR)) continue; if ((flags & CF_NOFILES) && (ent->ce_type != CVS_ENT_DIR))