summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>1996-05-13 20:22:05 +0000
committerRoland McGrath <roland@redhat.com>1996-05-13 20:22:05 +0000
commit2a905c5e5a0166865c66a50c7c59e8db43771fab (patch)
tree664a033490eee742ca1abd01aadb3c33fbae730c /file.c
parent0ddf0df13c298fc48548d32cc8fca04ef190093d (diff)
downloadgunmake-2a905c5e5a0166865c66a50c7c59e8db43771fab.tar.gz
Sun May 12 19:19:43 1996 Aaron Digulla <digulla@fh-konstanz.de>
* dir.c: New function: amigafy() to fold filenames Changes HASH() to HASHI() to fold filenames on Amiga. Stringcompares use strieq() instead of streq() The current directory on Amiga is "" instead of "." * file.c: Likewise.
Diffstat (limited to 'file.c')
-rw-r--r--file.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/file.c b/file.c
index 5bf4708..aa31077 100644
--- a/file.c
+++ b/file.c
@@ -73,17 +73,21 @@ lookup_file (name)
#ifdef VMS
name = "[]";
#else
+#ifdef _AMIGA
+ name = "";
+#else
name = "./";
-#endif
+#endif /* AMIGA */
+#endif /* VMS */
hashval = 0;
for (n = name; *n != '\0'; ++n)
- HASH (hashval, *n);
+ HASHI (hashval, *n);
hashval %= FILE_BUCKETS;
for (f = files[hashval]; f != 0; f = f->next)
{
- if (streq (f->name, name))
+ if (strieq (f->name, name))
{
return f;
}
@@ -120,11 +124,11 @@ enter_file (name)
hashval = 0;
for (n = name; *n != '\0'; ++n)
- HASH (hashval, *n);
+ HASHI (hashval, *n);
hashval %= FILE_BUCKETS;
for (f = files[hashval]; f != 0; f = f->next)
- if (streq (f->name, name))
+ if (strieq (f->name, name))
break;
if (f != 0 && !f->double_colon)
@@ -178,7 +182,7 @@ rename_file (file, name)
oldhash = 0;
for (n = oldname; *n != '\0'; ++n)
- HASH (oldhash, *n);
+ HASHI (oldhash, *n);
file_hash_enter (file, name, oldhash, file->name);
}
@@ -198,13 +202,13 @@ file_hash_enter (file, name, oldhash, oldname)
newhash = 0;
for (n = name; *n != '\0'; ++n)
- HASH (newhash, *n);
+ HASHI (newhash, *n);
newbucket = newhash % FILE_BUCKETS;
/* Look for an existing file under the new name. */
for (oldfile = files[newbucket]; oldfile != 0; oldfile = oldfile->next)
- if (streq (oldfile->name, name))
+ if (strieq (oldfile->name, name))
break;
if (oldhash != 0 && (newbucket != oldbucket || oldfile != 0))