From 21cf8c64441103bf875a56b39f39397ecd51424e Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Thu, 11 Jul 2002 06:38:57 +0000 Subject: 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. --- ar.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'ar.c') 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] == ')') -- cgit v1.2.3