From 00c3a8127a329b1e56c702e147d9a1d6c3351f0e Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 7 Apr 1993 04:52:01 +0000 Subject: [PATCH] GNU file utilities --- lib/Makefile.in | 5 ++++- lib/backupfile.c | 10 ++++++---- lib/fnmatch.c | 3 ++- lib/makepath.c | 4 +++- lib/userspec.c | 2 ++ 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/lib/Makefile.in b/lib/Makefile.in index d441c4e3c..fb21e13dc 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -64,7 +64,10 @@ realclean: distclean rm -f TAGS dist: - ln $(DISTFILES) ../`cat ../.fname`/lib + for file in $(DISTFILES); do \ + ln $$file ../`cat ../.fname`/lib \ + || cp $$file ../`cat ../.fname`/lib; \ + done libfu.a: $(OBJECTS) rm -f $@ diff --git a/lib/backupfile.c b/lib/backupfile.c index 94bb55a26..7a624cfec 100644 --- a/lib/backupfile.c +++ b/lib/backupfile.c @@ -60,12 +60,14 @@ char *malloc (); #endif -#ifndef isascii -#define ISDIGIT(c) (isdigit ((unsigned char) (c))) -#else -#define ISDIGIT(c) (isascii (c) && isdigit (c)) +#if !defined (isascii) || defined (STDC_HEADERS) +#undef isascii +#define isascii(c) 1 #endif +#define ISDIGIT(c) (isascii ((unsigned char ) c) \ + && isdigit ((unsigned char) (c))) + #if defined (HAVE_UNISTD_H) #include #endif diff --git a/lib/fnmatch.c b/lib/fnmatch.c index be662d9d2..20e2b5050 100644 --- a/lib/fnmatch.c +++ b/lib/fnmatch.c @@ -77,7 +77,8 @@ fnmatch (pattern, string, flags) return 0; { - char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? FOLD (*p) : c; + char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c; + c1 = FOLD (c1); for (--p; *n != '\0'; ++n) if ((c == '[' || FOLD (*n) == c1) && fnmatch (p, n, flags & ~FNM_PERIOD) == 0) diff --git a/lib/makepath.c b/lib/makepath.c index 12da458cf..4c19630e6 100644 --- a/lib/makepath.c +++ b/lib/makepath.c @@ -51,7 +51,9 @@ extern int errno; #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include +#ifndef index #define index strchr +#endif #else #include #endif @@ -93,7 +95,7 @@ make_path (argpath, mode, parent_mode, owner, group, verbose_fmt_string) int retval = 0; int oldmask = umask (0); - dirpath = alloca (strlen (argpath) + 1); + dirpath = (char *) alloca (strlen (argpath) + 1); strcpy (dirpath, argpath); if (stat (dirpath, &stats)) diff --git a/lib/userspec.c b/lib/userspec.c index a417cca4c..44d7d9174 100644 --- a/lib/userspec.c +++ b/lib/userspec.c @@ -24,7 +24,9 @@ #if defined(STDC_HEADERS) || defined(HAVE_STRING_H) #include +#ifndef index #define index strchr +#endif #else #include #endif -- 2.11.0