summaryrefslogtreecommitdiffstats
path: root/contrib/cvs/src/ignore.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/cvs/src/ignore.c')
-rw-r--r--contrib/cvs/src/ignore.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/contrib/cvs/src/ignore.c b/contrib/cvs/src/ignore.c
index df08017..4ea61ad 100644
--- a/contrib/cvs/src/ignore.c
+++ b/contrib/cvs/src/ignore.c
@@ -333,9 +333,7 @@ ign_dir_add (name)
(dir_ign_max + 1) * sizeof (char *));
}
- dir_ign_list[dir_ign_current] = name;
-
- dir_ign_current += 1 ;
+ dir_ign_list[dir_ign_current++] = xstrdup (name);
}
@@ -414,9 +412,9 @@ ignore_files (ilist, entries, update_dir, proc)
{
file = dp->d_name;
if (strcmp (file, ".") == 0 || strcmp (file, "..") == 0)
- continue;
+ goto continue_loop;
if (findnode_fn (ilist, file) != NULL)
- continue;
+ goto continue_loop;
if (subdirs)
{
Node *node;
@@ -437,14 +435,14 @@ ignore_files (ilist, entries, update_dir, proc)
dir = isdir (p);
free (p);
if (dir)
- continue;
+ goto continue_loop;
}
}
/* We could be ignoring FIFOs and other files which are neither
regular files nor directories here. */
if (ign_name (file))
- continue;
+ goto continue_loop;
if (
#ifdef DT_DIR
@@ -455,9 +453,12 @@ ignore_files (ilist, entries, update_dir, proc)
if (
#ifdef DT_DIR
- dp->d_type == DT_DIR || dp->d_type == DT_UNKNOWN &&
+ dp->d_type == DT_DIR
+ || (dp->d_type == DT_UNKNOWN && S_ISDIR (sb.st_mode))
+#else
+ S_ISDIR (sb.st_mode)
#endif
- S_ISDIR(sb.st_mode))
+ )
{
if (! subdirs)
{
@@ -468,7 +469,7 @@ ignore_files (ilist, entries, update_dir, proc)
if (isdir (temp))
{
free (temp);
- continue;
+ goto continue_loop;
}
free (temp);
}
@@ -476,16 +477,20 @@ ignore_files (ilist, entries, update_dir, proc)
#ifdef S_ISLNK
else if (
#ifdef DT_DIR
- dp->d_type == DT_LNK || dp->d_type == DT_UNKNOWN &&
+ dp->d_type == DT_LNK
+ || (dp->d_type == DT_UNKNOWN && S_ISLNK(sb.st_mode))
+#else
+ S_ISLNK (sb.st_mode)
#endif
- S_ISLNK(sb.st_mode))
+ )
{
- continue;
+ goto continue_loop;
}
#endif
}
(*proc) (file, xdir);
+ continue_loop:
errno = 0;
}
if (errno != 0)
OpenPOWER on IntegriCloud