diff options
Diffstat (limited to 'contrib/cvs/src/ignore.c')
-rw-r--r-- | contrib/cvs/src/ignore.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/contrib/cvs/src/ignore.c b/contrib/cvs/src/ignore.c index e9bcf79..65b2260 100644 --- a/contrib/cvs/src/ignore.c +++ b/contrib/cvs/src/ignore.c @@ -65,13 +65,11 @@ ign_setup () ign_add (tmp, 0); free (tmp); -#ifdef CLIENT_SUPPORT /* The client handles another way, by (after it does its own ignore file 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 (!current_parsed_root->isremote) -#endif { char *file = xmalloc (strlen (current_parsed_root->directory) + sizeof (CVSROOTADM) + sizeof (CVSROOTADM_IGNORE) + 10); @@ -237,10 +235,25 @@ ign_add (ign, hold) free (ign_list[i]); ign_hold = -1; } - s_ign_list = (char **) xmalloc (ign_count * sizeof (char *)); - for (i = 0; i < ign_count; i++) - s_ign_list[i] = ign_list[i]; - s_ign_count = ign_count; + if (s_ign_list) + { + /* Don't save the ignore list twice - if there are two + * bangs in a local .cvsignore file then we don't want to + * save the new list the first bang created. + * + * We still need to free the "new" ignore list. + */ + for (i = 0; i < ign_count; i++) + free (ign_list[i]); + } + else + { + /* Save the ignore list for later. */ + s_ign_list = xmalloc (ign_count * sizeof (char *)); + for (i = 0; i < ign_count; i++) + s_ign_list[i] = ign_list[i]; + s_ign_count = ign_count; + } ign_count = 1; /* Always ignore the "CVS" directory. */ ign_list[0] = xstrdup ("CVS"); @@ -331,7 +344,7 @@ ignore_directory (name) i = dir_ign_current; while (i--) { - if (strncmp (name, dir_ign_list[i], strlen (dir_ign_list[i])) == 0) + if (strncmp (name, dir_ign_list[i], strlen (dir_ign_list[i])+1) == 0) return 1; } |