Fixed several small issues
- Fixed uninitialized values found by valgrind. - Fixed uninitialized value in lfs_dir_fetchmatch when handling revision counts. - Fixed mess left by lfs_dir_find when attempting to find the root directory in lfs_rename and lfs_remove. - Fixed corner case with definitions of lfs->cfg->block_cycles. - Added test cases around different forms of the root directory. I think all of these were found by TheLoneWolfling, so props!
This commit is contained in:
@@ -128,6 +128,14 @@ tests/test.py << TEST
|
||||
lfs_mkdir(&lfs, "/") => LFS_ERR_EXIST;
|
||||
lfs_file_open(&lfs, &file[0], "/", LFS_O_WRONLY | LFS_O_CREAT)
|
||||
=> LFS_ERR_ISDIR;
|
||||
|
||||
// more corner cases
|
||||
lfs_remove(&lfs, "") => LFS_ERR_INVAL;
|
||||
lfs_remove(&lfs, ".") => LFS_ERR_INVAL;
|
||||
lfs_remove(&lfs, "..") => LFS_ERR_INVAL;
|
||||
lfs_remove(&lfs, "/") => LFS_ERR_INVAL;
|
||||
lfs_remove(&lfs, "//") => LFS_ERR_INVAL;
|
||||
lfs_remove(&lfs, "./") => LFS_ERR_INVAL;
|
||||
lfs_unmount(&lfs) => 0;
|
||||
TEST
|
||||
|
||||
|
||||
Reference in New Issue
Block a user