]> git.ipfire.org Git - thirdparty/make.git/commitdiff
* Add strneq() (streq only n chars) macro
authorPaul Smith <psmith@gnu.org>
Fri, 19 Mar 1999 04:27:56 +0000 (04:27 +0000)
committerPaul Smith <psmith@gnu.org>
Fri, 19 Mar 1999 04:27:56 +0000 (04:27 +0000)
* fix return type of xstrdup.

make.h
misc.c

diff --git a/make.h b/make.h
index d5bbe7eb98dfda6d67eab0ac5ff1e243d70ed63c..b170d5920d04f8d188d86764ce7e504c08f98237 100644 (file)
--- a/make.h
+++ b/make.h
@@ -298,6 +298,8 @@ extern char *alloca ();
 # define strieq(a, b) (strcmp ((a), (b)) == 0)
 #endif
 
+#define strneq(a, b, n) (strncmp((a), (b), (n)) == 0)
+
 /* Add to VAR the hashing value of C, one character in a name.  */
 #define HASH(var, c) \
   ((var += (c)), (var = ((var) << 7) + ((var) >> 20)))
diff --git a/misc.c b/misc.c
index 505b1867d4d08c1161a140566ed588e59008642e..451a675e8fd5b135dcf643c5ee8d5de499b361f1 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -379,7 +379,7 @@ xrealloc (ptr, size)
 }
 
 
-const char *
+char *
 xstrdup (ptr)
      const char *ptr;
 {