summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>1992-11-04 01:44:30 +0000
committerRoland McGrath <roland@redhat.com>1992-11-04 01:44:30 +0000
commit8c9b95d07ec5a89eef9de6eb7e82fd91674f7fb6 (patch)
tree1031cffda993cd1af0bd7407a6a56ba72c78cf69
parentdb8c8b2ad8179cdc48df986136b8058b84a600e6 (diff)
downloadgunmake-8c9b95d07ec5a89eef9de6eb7e82fd91674f7fb6.tar.gz
Formerly file.c.~20~
-rw-r--r--file.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/file.c b/file.c
index d516629..a934013 100644
--- a/file.c
+++ b/file.c
@@ -163,7 +163,6 @@ rename_file (file, name)
oldhash = 0;
for (n = oldname; *n != '\0'; ++n)
HASH (oldhash, *n);
- oldhash %= FILE_BUCKETS;
file_hash_enter (file, name, oldhash, file->name);
}
@@ -197,6 +196,8 @@ file_hash_enter (file, name, oldhash, oldname)
struct file *lastf = 0;
+ oldhash %= FILE_BUCKETS;
+
for (f = files[oldhash]; f != file; f = f->next)
lastf = f;
@@ -238,11 +239,17 @@ file_hash_enter (file, name, oldhash, oldname)
/* We have two sets of commands. We will go with the
one given in the rule explicitly mentioning this name,
but give a message to let the user know what's going on. */
- makefile_error (file->cmds->filename, file->cmds->lineno,
- "Commands were specified for \
+ if (oldfile->cmds->filename != 0)
+ makefile_error (file->cmds->filename, file->cmds->lineno,
+ "Commands were specified for \
file `%s' at %s:%u,",
- oldname, oldfile->cmds->filename,
- oldfile->cmds->lineno);
+ oldname, oldfile->cmds->filename,
+ oldfile->cmds->lineno);
+ else
+ makefile_error (file->cmds->filename, file->cmds->lineno,
+ "Commands for file `%s' were found by \
+implicit rule search,",
+ oldname);
makefile_error (file->cmds->filename, file->cmds->lineno,
"but `%s' is now considered the same file \
as `%s'.",