]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
merge with 1.11.5b
authorJim Meyering <jim@meyering.net>
Thu, 15 Jun 1995 16:46:34 +0000 (16:46 +0000)
committerJim Meyering <jim@meyering.net>
Thu, 15 Jun 1995 16:46:34 +0000 (16:46 +0000)
lib/regex.c
src/md5sum.c

index a4959ef539a793acbf7abffac6731fb444fdec35..1cf91969670bc71bd750c3271b73535928674f94 100644 (file)
@@ -62,8 +62,19 @@ char *malloc ();
 char *realloc ();
 #endif
 
-/* We used to test for `BSTRING' here, but only GCC and Emacs define
-   `BSTRING', as far as I know, and neither of them use this code.  */
+/* When used in Emacs's lib-src, we need to get bzero and bcopy somehow.
+   If nothing else has been done, use the method below.  */
+#ifdef INHIBIT_STRING_HEADER
+#if !(defined (HAVE_BZERO) && defined (HAVE_BCOPY))
+#if !defined (bzero) && !defined (bcopy)
+#undef INHIBIT_STRING_HEADER
+#endif
+#endif
+#endif
+
+/* This is the normal way of making sure we have a bcopy and a bzero.
+   This is used in most programs--a few other programs avoid this
+   by defining INHIBIT_STRING_HEADER.  */
 #ifndef INHIBIT_STRING_HEADER
 #if HAVE_STRING_H || STDC_HEADERS || defined (_LIBC)
 #include <string.h>
index 3517fba55b63bc74d9c14da31187859314942899..0b95ff5d1229a9ef2ba2efc8acdd65c8aa73a8b4 100644 (file)
@@ -120,6 +120,8 @@ typedef unsigned short uint32;
 # endif
 #endif
 
+#define TOLOWER(c) (ISUPPER (c) ? tolower (c) : (c))
+
 /* Hook for i18n.  */
 #define _(str) str
 
@@ -350,8 +352,8 @@ main (argc, argv)
              /* Compare generated binary number with text representation
                 in check file.  Ignore case of hex digits.  */
              for (cnt = 0; cnt < 16; ++cnt)
-               if (tolower (md5num[2 * cnt]) != bin2hex[md5buffer[cnt] >> 4]
-                   || tolower (md5num[2 * cnt + 1])
+               if (TOLOWER (md5num[2 * cnt]) != bin2hex[md5buffer[cnt] >> 4]
+                   || TOLOWER (md5num[2 * cnt + 1])
                       != (bin2hex[md5buffer[cnt] & 0xf]))
                  break;
 
@@ -481,7 +483,7 @@ md5_file (filename, resblock, binary)
        }
       while (sum < BLOCKSIZE && n != 0);
 
-      /* RFC 1321 specifies the possible length of the file upto 2^64 bits.
+      /* RFC 1321 specifies the possible length of the file up to 2^64 bits.
         Here we only compute the number of bytes.  Do a double word
          increment.  */
       len[0] += sum;