bug-gnulib
[Top][All Lists]
Advanced

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

[Bug-gnulib] exclude.c port to Solaris 7 etc.


From: Paul Eggert
Subject: [Bug-gnulib] exclude.c port to Solaris 7 etc.
Date: Tue, 10 Dec 2002 11:42:27 -0800

I installed the following patch.

2002-12-10  Paul Eggert  <address@hidden>

        Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
        * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
        Choose values that are less likely to collide with system fnmatch
        options.
        * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
        defined (e.g., a pure POSIX system).
        (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
        instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.

Index: exclude.h
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/exclude.h,v
retrieving revision 1.6
diff -p -u -r1.6 exclude.h
--- exclude.h   31 Aug 2001 06:34:06 -0000      1.6
+++ exclude.h   10 Dec 2002 19:38:13 -0000
@@ -1,5 +1,7 @@
 /* exclude.h -- declarations for excluding file names
-   Copyright 1992, 1993, 1994, 1997, 1999, 2001 Free Software Foundation, Inc.
+
+   Copyright (C) 1992, 1993, 1994, 1997, 1999, 2001, 2002 Free
+   Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -30,14 +32,14 @@
 
 /* Patterns must match the start of file names, instead of matching
    anywhere after a '/'.  */
-#define EXCLUDE_ANCHORED (1 << 5)
+#define EXCLUDE_ANCHORED (1 << 30)
 
 /* Include instead of exclude.  */
-#define EXCLUDE_INCLUDE (1 << 6)
+#define EXCLUDE_INCLUDE (1 << 29)
 
 /* '?', '*', '[', and '\\' are special in patterns.  Without this
    option, these characters are ordinary and fnmatch is not used.  */
-#define EXCLUDE_WILDCARDS (1 << 7)
+#define EXCLUDE_WILDCARDS (1 << 28)
 
 struct exclude;
 
Index: exclude.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/exclude.c,v
retrieving revision 1.10
diff -p -u -r1.10 exclude.c
--- exclude.c   17 Nov 2001 13:29:42 -0000      1.10
+++ exclude.c   10 Dec 2002 19:38:13 -0000
@@ -1,7 +1,7 @@
 /* exclude.c -- exclude file names
 
-   Copyright 1992, 1993, 1994, 1997, 1999, 2000, 2001 Free Software
-   Foundation, Inc.
+   Copyright (C) 1992, 1993, 1994, 1997, 1999, 2000, 2001, 2002 Free
+   Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -67,9 +67,17 @@ extern int errno;
 /* Verify a requirement at compile-time (unlike assert, which is runtime).  */
 #define verify(name, assertion) struct name { char a[(assertion) ? 1 : -1]; }
 
+/* Non-GNU systems lack these options, so we don't need to check them.  */
+#ifndef FNM_CASEFOLD
+# define FNM_CASEFOLD 0
+#endif
+#ifndef FNM_LEADING_DIR
+# define FNM_LEADING_DIR 0
+#endif
+
 verify (EXCLUDE_macros_do_not_collide_with_FNM_macros,
        (((EXCLUDE_ANCHORED | EXCLUDE_INCLUDE | EXCLUDE_WILDCARDS)
-         & (FNM_FILE_NAME | FNM_NOESCAPE | FNM_PERIOD | FNM_LEADING_DIR
+         & (FNM_PATHNAME | FNM_NOESCAPE | FNM_PERIOD | FNM_LEADING_DIR
             | FNM_CASEFOLD))
         == 0));
 



reply via email to

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