summaryrefslogtreecommitdiff
path: root/ar.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2002-07-11 06:38:57 +0000
committerPaul Smith <psmith@gnu.org>2002-07-11 06:38:57 +0000
commit21cf8c64441103bf875a56b39f39397ecd51424e (patch)
tree24ff4cecaa8603feffa1ecf5ed82a4199a51d673 /ar.c
parent4d72c4c11e3aff65e9bb36e5fcf75f088b140049 (diff)
downloadgunmake-21cf8c64441103bf875a56b39f39397ecd51424e.tar.gz
Install Greg McGary's patches to port the id-utils hashing functions to
GNU make. Also he provides some other performance fixups after doing some profiling of make on large makefiles. Modify the test suite to allow the use of Valgrind to find memory problems.
Diffstat (limited to 'ar.c')
-rw-r--r--ar.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/ar.c b/ar.c
index 3827f40..286be55 100644
--- a/ar.c
+++ b/ar.c
@@ -1,5 +1,6 @@
/* Interface to `ar' archives for GNU Make.
-Copyright (C) 1988,89,90,91,92,93,97 Free Software Foundation, Inc.
+Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1997,
+2002 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify
@@ -41,9 +42,14 @@ int
ar_name (name)
char *name;
{
- char *p = strchr (name, '('), *end = name + strlen (name) - 1;
+ char *p = strchr (name, '(');
+ char *end;
+
+ if (p == 0 || p == name)
+ return 0;
- if (p == 0 || p == name || *end != ')')
+ end = p + strlen (p) - 1;
+ if (*end != ')')
return 0;
if (p[1] == '(' && end[-1] == ')')