summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>1999-03-19 04:27:56 +0000
committerPaul Smith <psmith@gnu.org>1999-03-19 04:27:56 +0000
commit6ff09019b27e657d16efba0f1db63771a78c40a2 (patch)
tree16ced5095aaeb48ceabd53f0b697065938b4705b
parentff8dc8573beb9e5a76c3a94caca72780059354e4 (diff)
downloadmake-6ff09019b27e657d16efba0f1db63771a78c40a2.tar.gz
* Add strneq() (streq only n chars) macro
* fix return type of xstrdup.
-rw-r--r--make.h2
-rw-r--r--misc.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/make.h b/make.h
index d5bbe7eb..b170d592 100644
--- 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 505b1867..451a675e 100644
--- a/misc.c
+++ b/misc.c
@@ -379,7 +379,7 @@ xrealloc (ptr, size)
}
-const char *
+char *
xstrdup (ptr)
const char *ptr;
{