bug-gnu-utils
[Top][All Lists]
Advanced

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

Patch for findutils 4.1 on Tru64 Unix 5.1


From: Petter Reinholdtsen
Subject: Patch for findutils 4.1 on Tru64 Unix 5.1
Date: Thu, 19 Sep 2002 12:40:23 +0200

Here is a patch to get findutils compiling on Tru64 Unix version 5.1.
The <fnmatch.h> header file is missing definitions for FNM_FILE_NAME,
FNM_CASEFOLD and FNM_LEADING_DIR.

I'm not sure if this is the correct fix, but at least now it compiles.

diff -ur src-4.1/lib/fnmatch.c src-4.1-local/lib/fnmatch.c
--- src-4.1/lib/fnmatch.c       1994-09-26 23:04:34.000000000 +0100
+++ src-4.1-local/lib/fnmatch.c 2002-09-19 12:32:05.000000000 +0200
@@ -39,6 +39,10 @@
 extern int errno;
 #endif

+#if !defined(FNM_FILE_NAME) /* Missing on Tru64 Unix 5.1 */
+#  define FNM_FILE_NAME  FNM_PATHNAME
+#endif /* not FNM_FILE_NAME */
+
 /* Match STRING against the filename pattern PATTERN, returning zero if
    it matches, nonzero if not.  */
 int
@@ -50,8 +54,13 @@
   register const char *p = pattern, *n = string;
   register char c;

+#if defined(FNM_CASEFOLD)
 /* Note that this evalutes C many times.  */
 #define FOLD(c)        ((flags & FNM_CASEFOLD) && isupper (c) ? tolower (c) : 
(c))
+#else /* not FNM_CASEFOLD */
+/* Missing on Tru64 Unix 5.1 */
+#  define FOLD(c) (c)
+#endif /* not FNM_CASEFOLD */

   while ((c = *p++) != '\0')
     {
@@ -190,9 +199,11 @@
   if (*n == '\0')
     return 0;

+#if defined(FNM_LEADING_DIR) /* Missing on Tru64 Unix 5.1 */
   if ((flags & FNM_LEADING_DIR) && *n == '/')
     /* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz".  */
     return 0;
+#endif /* FNM_LEADING_DIR */

   return FNM_NOMATCH;
 }




reply via email to

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