diff options
author | peter <peter@FreeBSD.org> | 2001-08-10 09:43:22 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2001-08-10 09:43:22 +0000 |
commit | a037ef8f32200b26968e77344bcfb963251fa8b9 (patch) | |
tree | 2b4dc24b830b514680009ead3884ecb1c40974c7 /contrib/cvs/src/ignore.c | |
parent | 590c411955d6975551ffeaf41d7faf4b26f836d1 (diff) | |
download | FreeBSD-src-a037ef8f32200b26968e77344bcfb963251fa8b9.zip FreeBSD-src-a037ef8f32200b26968e77344bcfb963251fa8b9.tar.gz |
Import cvs-1.11.1p1 onto vendor branch
Diffstat (limited to 'contrib/cvs/src/ignore.c')
-rw-r--r-- | contrib/cvs/src/ignore.c | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/contrib/cvs/src/ignore.c b/contrib/cvs/src/ignore.c index 4ea61ad..b52632b 100644 --- a/contrib/cvs/src/ignore.c +++ b/contrib/cvs/src/ignore.c @@ -68,13 +68,13 @@ ign_setup () processing, and only if !ign_inhibit_server), letting the server know about the files and letting it decide whether to ignore them based on CVSROOOTADM_IGNORE. */ - if (!client_active) + if (!current_parsed_root->isremote) #endif { - char *file = xmalloc (strlen (CVSroot_directory) + sizeof (CVSROOTADM) + char *file = xmalloc (strlen (current_parsed_root->directory) + sizeof (CVSROOTADM) + sizeof (CVSROOTADM_IGNORE) + 10); /* Then add entries found in repository, if it exists */ - (void) sprintf (file, "%s/%s/%s", CVSroot_directory, + (void) sprintf (file, "%s/%s/%s", current_parsed_root->directory, CVSROOTADM, CVSROOTADM_IGNORE); ign_add_file (file, 0); free (file); @@ -379,6 +379,8 @@ ignore_files (ilist, entries, update_dir, proc) struct stat sb; char *file; char *xdir; + List *files; + Node *p; /* Set SUBDIRS if we have subdirectory information in ENTRIES. */ if (entries == NULL) @@ -407,14 +409,16 @@ ignore_files (ilist, entries, update_dir, proc) ign_add_file (CVSDOTIGNORE, 1); wrap_add_file (CVSDOTWRAPPER, 1); - errno = 0; - while ((dp = readdir (dirp)) != NULL) + /* Make a list for the files. */ + files = getlist (); + + while (errno = 0, (dp = CVS_READDIR (dirp)) != NULL) { file = dp->d_name; if (strcmp (file, ".") == 0 || strcmp (file, "..") == 0) - goto continue_loop; + continue; if (findnode_fn (ilist, file) != NULL) - goto continue_loop; + continue; if (subdirs) { Node *node; @@ -435,14 +439,14 @@ ignore_files (ilist, entries, update_dir, proc) dir = isdir (p); free (p); if (dir) - goto continue_loop; + continue; } } /* We could be ignoring FIFOs and other files which are neither regular files nor directories here. */ if (ign_name (file)) - goto continue_loop; + continue; if ( #ifdef DT_DIR @@ -469,7 +473,7 @@ ignore_files (ilist, entries, update_dir, proc) if (isdir (temp)) { free (temp); - goto continue_loop; + continue; } free (temp); } @@ -484,16 +488,22 @@ ignore_files (ilist, entries, update_dir, proc) #endif ) { - goto continue_loop; + continue; } #endif - } + } - (*proc) (file, xdir); - continue_loop: - errno = 0; + p = getnode (); + p->type = FILES; + p->key = xstrdup (file); + (void) addnode (files, p); } if (errno != 0) error (0, errno, "error reading current directory"); - (void) closedir (dirp); + (void) CVS_CLOSEDIR (dirp); + + sortlist (files, fsortcmp); + for (p = files->list->next; p != files->list; p = p->next) + (*proc) (p->key, xdir); + dellist (&files); } |