bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Patch] Enhance ignore functionality to differently handle regular files


From: Eckard Brauer
Subject: [Patch] Enhance ignore functionality to differently handle regular files and directories
Date: Tue, 25 Feb 2003 17:11:09 +0100

Hi there,

please respond to my email address, because I'm no regular list member.

I've got a cvs problem here, because I tried to manage a project
containing directories named "core". In file ignore.c I found:

--- snip! ---
 const char *ign_default = ". .. core RCSLOG tags TAGS RCS SCCS
 .make.state .nse_depinfo #* .#* cvslog.* ,* CVS CVS.adm .del-* *.a
 *.olb *.o *.obj *.so *.Z *~ *.old *.elc *.ln *.bak *.BAK *.orig *.rej
 *.exe _$* *$";
 ...
 void
 ign_setup ()
 {
 ...
     tmp = xstrdup (ign_default);
     ign_add (tmp, 0);
     free (tmp);
 ...
--- snap! ---

So I decided for me to mark directories with a slash ('/') character at
the end and so be able to handle them different. Here are my changes,
I'd be glad if you can live with that change (and include it, at least
as an option):

--- snip! ---
--- cvs-1.11.5/src/ignore.c     Tue Feb 25 16:56:20 2003
+++ cvs-1.11.5/src/ignore.c.orig        Tue Feb 25 11:21:54 2003
@@ -33,8 +33,8 @@
 static int ign_hold = -1;              /* Index where first "temporary" item
                                         * is held */
 
-const char *ign_default = "./ ../ core RCSLOG tags TAGS RCS SCCS
.make.state\- .nse_depinfo #* .#* cvslog.* ,* CVS/ CVS.adm .del-* *.a
*.olb *.o *.obj\+const char *ign_default = ". .. core RCSLOG tags TAGS
RCS SCCS .make.state\+ .nse_depinfo #* .#* cvslog.* ,* CVS CVS.adm
.del-* *.a *.olb *.o *.obj\  *.so *.Z *~ *.old *.elc *.ln *.bak *.BAK
*.orig *.rej *.exe _$* *$"; 
 #define IGN_GROW 16                    /* grow the list by 16 elements at a
@@ -266,7 +266,6 @@
     char *name;
 {
     char **cpp = ign_list;
-       DIR      *d;
 
     if (cpp == NULL)
        return (0);
@@ -301,32 +300,13 @@
        free (pat_lower);
        return 1;
     }
-    else if (name && *name && (d = opendir(name)) && *cpp) {
-               /* check if name is a directory. In this case handle only
patterns-                * ending with a '/' character. Otherwise goto normal
operation. */-          char *nn = NULL;
-
-               closedir(d);
-
-               do
-                       if ((*cpp)[strlen(*cpp) - 1] == '/') {
-                               nn = xstrdup(*cpp);
-                               nn[strlen(nn) - 1] = '\0';
-                               if (CVS_FNMATCH (nn, name, 0) == 0) {
-                                       free(nn);
-                                       return 1;
-                               }
-                       }
-               while (*++cpp);
-               if (nn)
-                       free(nn);
-               return 0;
-       } else {
-               while (*cpp)
-                       if (CVS_FNMATCH (*cpp++, name, 0) == 0)
-                               return 1;
-               return 0;
-       }
+    else
+    {
+       while (*cpp)
+           if (CVS_FNMATCH (*cpp++, name, 0) == 0)
+               return 1;
+       return 0;
+    }
 }
 
 /* FIXME: This list of dirs to ignore stuff seems not to be used.
--- snap! ---

Sincerely!
Eckard

-- 
Eckard Brauer, Support Engineer, Intershop Communications GmbH,
smail: Intershop Tower, 07740 Jena, Germany
phone: +49-3641-50-3459




reply via email to

[Prev in Thread] Current Thread [Next in Thread]