# HG changeset patch # User menikon # Date 1580712084 -32400 # Node ID f26b3dcbc6db6a60f4b40a170554debd58b43fb0 # Parent c6cbe4711e02cf611dac55b95d48c1be3897896d tweak diff -r c6cbe4711e02 -r f26b3dcbc6db src/impl/fs_impl.cbc --- a/src/impl/fs_impl.cbc Mon Feb 03 15:29:54 2020 +0900 +++ b/src/impl/fs_impl.cbc Mon Feb 03 15:41:24 2020 +0900 @@ -167,9 +167,9 @@ goto next(...); } -__code namecmpfs_impl(struct fs_impl* fs, const char* s, const char* t, __code next(...)) { - - goto next(...); +__code namecmpfs_impl(struct fs_impl* fs, const char* s, const char* t, __code next(int strncmp_val, ...)) { + strncmp_val = strncmp(s, t, DIRSIZ); + goto next(strncmp_val, ...); } __code dirlookupfs_impl(struct inode* dp, char* name, uint* poff, __code next(...)) { diff -r c6cbe4711e02 -r f26b3dcbc6db src/interface/fs.dg --- a/src/interface/fs.dg Mon Feb 03 15:29:54 2020 +0900 +++ b/src/interface/fs.dg Mon Feb 03 15:41:24 2020 +0900 @@ -17,6 +17,7 @@ char* path; char* src; int namex_val; + int strncmp_val; __code readsb(Impl* fs, uint dev, struct superblock* sb, __code next(...)); __code iinit(Impl* fs, __code next(...)); @@ -30,7 +31,7 @@ __code stati(Impl* fs , struct inode* ip, struct stat* st, __code next(...)); __code readi(Impl* fs, struct inode* ip, char* dst, uint off, uint n, __code next(...)); __code writei(Impl* fs, struct inode* ip, char* src, uint off, uint n, __code next(...)); - __code namecmp(Impl* fs, const char* s, const char* t, __code next(...)); + __code namecmp(Impl* fs, const char* s, const char* t, __code next(int strncmp_val, ...)); __code dirlookup(struct inode* dp, char* name, uint* poff, __code next(...)); __code dirlink(Impl* fs, struct inode* dp, char* name, uint inum, __code next(...)); __code namei(Impl* fs, char* path, __code next(int namex_val, ...));