From 008dab1b259c1d032a0b3e073e0e67a4615f8412 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 31 Mar 1992 00:24:58 +0000 Subject: [PATCH] Formerly commands.c.~2~ --- commands.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/commands.c b/commands.c index 2fbdc9a9..94097e2a 100644 --- a/commands.c +++ b/commands.c @@ -1,5 +1,5 @@ /* Command processing for GNU Make. -Copyright (C) 1988, 1989, 1991 Free Software Foundation, Inc. +Copyright (C) 1988, 1989, 1991, 1992 Free Software Foundation, Inc. This file is part of GNU Make. GNU Make is free software; you can redistribute it and/or modify @@ -74,13 +74,28 @@ set_file_variables (file) any suffix in the .SUFFIXES list stripped off for explicit rules. We store this in the `stem' member. */ register struct dep *d; + char *name; + unsigned int len; + +#ifndef NO_ARCHIVES + if (ar_name (file->name)) + { + name = index (file->name, '(') + 1; + len = strlen (name) - 1; + } + else +#endif + { + name = file->name; + len = strlen (name); + } + for (d = enter_file (".SUFFIXES")->deps; d != 0; d = d->next) { - unsigned int len = strlen (file->name); unsigned int slen = strlen (dep_name (d)); - if (len > slen && streq (dep_name (d), file->name + len - slen)) + if (len > slen && !strncmp (dep_name (d), name + len - slen, slen)) { - file->stem = savestring (file->name, len - slen); + file->stem = savestring (name, len - slen); break; } }