diff options
author | Roland McGrath <roland@redhat.com> | 1996-05-13 20:22:05 +0000 |
---|---|---|
committer | Roland McGrath <roland@redhat.com> | 1996-05-13 20:22:05 +0000 |
commit | 2a905c5e5a0166865c66a50c7c59e8db43771fab (patch) | |
tree | 664a033490eee742ca1abd01aadb3c33fbae730c /file.c | |
parent | 0ddf0df13c298fc48548d32cc8fca04ef190093d (diff) | |
download | gunmake-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.c | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -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)) |