GNU file utilities
[gnulib.git] / lib / backupfile.c
index 94bb55a..670db0f 100644 (file)
 #include "backupfile.h"
 #if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
 #include <string.h>
+#ifndef index
 #define index strchr
+#endif
+#ifndef rindex
 #define rindex strrchr
+#endif
 #else
 #include <strings.h>
 #endif
 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 <unistd.h>
 #endif
@@ -210,7 +216,7 @@ concat (str1, str2)
      char *str1, *str2;
 {
   char *newstr;
-  char str1_length = strlen (str1);
+  int str1_length = strlen (str1);
 
   newstr = malloc (str1_length + strlen (str2) + 1);
   if (newstr == 0)