summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'file.c')
-rw-r--r--file.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/file.c b/file.c
index b264d9d..dbb8fc3 100644
--- a/file.c
+++ b/file.c
@@ -187,6 +187,23 @@ rehash_file (file, name)
file_hash_enter (file, name, oldhash, file->name);
}
+/* Rename FILE to NAME. This is not as simple as resetting
+ the `name' member, since it must be put in a new hash bucket,
+ and possibly merged with an existing file called NAME. */
+
+void
+rename_file (file, name)
+ register struct file *file;
+ char *name;
+{
+ rehash_file(file, name);
+ while (file)
+ {
+ file->name = file->hname;
+ file = file->prev;
+ }
+}
+
void
file_hash_enter (file, name, oldhash, oldname)
register struct file *file;