diff --git a/src/filesrch.c b/src/filesrch.c
index 3f901b6958711aaf13723bba4b1e7e7771bc7902..23b8e7f409b5c450f0d507b2075bebb611efa508 100644
--- a/src/filesrch.c
+++ b/src/filesrch.c
@@ -797,6 +797,7 @@ lumpinfo_t *getdirectoryfiles(const char *path, UINT16 *nlmp, UINT16 *nfolders)
 		// The complete name of the file, with its extension,
 		// excluding the path of the directory where it resides.
 		lump_p->fullname = Z_StrDup(fullname);
+		lump_p->hash = quickncasehash(lump_p->name, 8);
 
 		lump_p++;
 		i++;