Skip to content

Commit

Permalink
Fixed caching root file err
Browse files Browse the repository at this point in the history
  • Loading branch information
WestleyK committed Dec 13, 2019
1 parent 98e1755 commit 6ff5451
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 20 deletions.
13 changes: 7 additions & 6 deletions checksum.sha256sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
0f4e6b94f0f6444fa058b8c67cb852586a72a2c21550927debaa061ff6316d6a ./lf
0ce1c7235e7a2cf832044217044a240dc2b1f58cfceb560b6525856493a4dc9a ./lf
5864b0502bb3ffd5c6e1454937fd9c6ba43212fd6a251a00973bfe93a230675a ./tests-funcs
ecbd817a39e0ec1908d226257f0466b98242577d56b83d50d0c9580ae2892f83 ./Makefile
4e8d2ef0cab53d73d8c2c2a8ca07f2ed87632ed7a7b508f6a32b5777b405b2e9 ./src/add_slash.c
Expand All @@ -10,16 +10,15 @@ b96b90bea578c4b5f9888dc1ed5c7be7231dc1a2882103a089d3e19a14b11526 ./src/iszip.c
cb23437d17e9a9e3510bba573753ae31053760b562792d9905d7075b72dcd419 ./src/add_slash.h
2410b8760ef3125ec104cd16b55463258768041501c54b32cad85fc13ecfd082 ./src/add_slash.o
e608c24e419cf92fac3e5ac8c07dccac6eb3f8ba453c275a2917f69ebbf98ded ./src/extcmp.c
ed8e0cb57fd9d1b2c9b287876a815b4848151259d54206c01a28f3fcfe4837e2 ./src/main-lf.o
66a74feb32539fb9d180257d7a11a8ad40f1267abefb18d77c2597d472f09df9 ./src/main-lf.o
96437532ce0d5b1b58fba64113ed48bdfb29ff57c926352d864e4986c7883c15 ./src/extcmp.o
be213be49bfad26f68ae579860fbbdbcbe926259b9157f1033b2029076f27da8 ./src/extcmp.h
7cbda1428c63372232c060798f7523e4b8b45f8f38c271e699e6259b0a9a3bf3 ./src/main-lf.c
feb1792a31f0f026ddbb572d0d0c64634d139799be76592f6efae77968eca836 ./src/main-lf.c
a4b324972794e322303c925395866c064ed4542c8e07b8064c0c8cbcea4a7ed2 ./src/find_link.c
ce87cc7cb9194a093ec7f4a1556169c41c11e079d404580944a325fbe82bcce8 ./src/readable-fs.o
4914567d1735fdc6c8299ea3a9203166a656e4ecfffb0510958d91f6826784c7 ./src/color.h
111bdedf18f006d3b259419579d2456635fa761b9fc8e253e9a9abbc71ef3253 ./src/find_link.o
061011c25dfa41869c13e2336d559b01e55a032d246004d6a2cdb303c30c80b7 ./src/readable-fs.c
696d0e9afe0b29d0d810bd93d32e7e8323959cf0ce93d9b0408181dd8b5e088c ./checksum.ssum
ae231633e0182d0914bb1501d71260a7422db51783939766070a872b9ae4b24f ./deps/c-utils/c-utils.c
17e7fdf3e3062bb17f3789ecdd885b900a912cba8a5b9c7948b47622de80c0f0 ./deps/c-utils/c-utils.h
a3e94c68b0b6ca857afe281d27dc85d69fa58b143b7769ffcacafcdedd82db03 ./deps/c-utils/c-utils.o
Expand All @@ -29,10 +28,12 @@ f8214a223a389d814f251464e385509492e15fd42c663f7fd9ae3adb96d8aca7 ./tests/2.fail
24d72cf8a18c504e0301052b38c9b510a460d73b01c84ada4df552ab33a0a426 ./tests/11.-m_compair_with_ls_wc
8f6a6e8d76a2458820e519bd904fd3572099936dc77011befa5f510c5d54bd3a ./tests/9.compair_with_ls_wc
d15eefd2c75808159c7a93b81833a0d37701dfe7cf89159d6627725af5c7ed0b ./tests/4.-a_option
163257678ed22385fa8348bd2f23a0850d24bb609715a8a20148ec45a61b4d86 ./tests/22.one-root-file
52aa50ebf12be467a6e199053a09853d9e4ab3deb47ff5dc58282c8ede699566 ./tests/21.broken-link
b6b7fd1b867766a17455dae0613cff48a00875b73aa5b35a40eccb7ef6c4535b ./tests/12.version_flag
72bc30bd85d75d05c5eeca0df5481028d4b05593848133a144b580af382e3a60 ./tests/testdata/.fileh
72bc30bd85d75d05c5eeca0df5481028d4b05593848133a144b580af382e3a60 ./tests/testdata/file1
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 ./tests/testdata/root-file
1785cfc3bc6ac7738e8b38cdccd1af12563c2b9070e07af336a1bf8c0f772b6a ./tests/testdata/file_r
72bc30bd85d75d05c5eeca0df5481028d4b05593848133a144b580af382e3a60 ./tests/testdata/filex
72bc30bd85d75d05c5eeca0df5481028d4b05593848133a144b580af382e3a60 ./tests/testdata/.file_x_h
Expand All @@ -46,9 +47,9 @@ c768276010b1eaa18391bcfadf721156e9c30c9e270cf132257e2708266ef666 ./tests/19.inv
a600796cbac5fe3ef360faf28c73ce1dc05d971cf626690cb51b2ea06c240282 ./tests/18.file_bytes
820eb2979e78be4b27aabd77ea61d36c75365fbfeb68ca4e7f0b41cf42743d93 ./tests/17.link_file_test
06d6e7dce402d1ee014faabaaedfcfc9f6f30b616ab26c66b3b9a473973c7298 ./tests/20.help-test
10d16e441815b20b24d46453068c5936921b7a5a745558905475194f76eddaa6 ./tests/7.pipe_to_wc
87311c071d33ff3f1a92571814bbd7c13fdf005867ec1fdb3ea075f9c8114d12 ./tests/7.pipe_to_wc
bae9ff197bc78d7ec52d9c0b1e03c32d12ae1f3ce4b0ca78428963327af23ed1 ./tests/13.unknown_flag
81ad42b8c151fe81617be7bc4ce2bb45f8426813d80596a10dbc0c855767e61f ./tests/8.more_then_one_dir_list
d4e8e79c3f808bfea892095a53dd5d5df9be3e1f06607d9e816c823e70c145a7 ./tests/8.more_then_one_dir_list
cfbdb5e07e398c787383cfff03f56c7fd93ac43689304c56e1e2c18582b28c7c ./tests/6.force_color
464a286f0ea4c396991edbe243308adfd2688d4e4517e733b0e0f2ebe945b44c ./tests/1.lf-basic
90ea793c00a2134ec6514b7fd847ed2d4b6789a5546ddf4f8183fd5631922a44 ./tests/16.no_perm_file_check
Expand Down
11 changes: 7 additions & 4 deletions checksum.ssum
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
98237076 ./lf
d5864fa4 ./tests-funcs
a446e7ef ./Makefile
1d34ef9f ./src/add_slash.c
Expand All @@ -9,15 +10,16 @@ a4a200f1 ./src/iszip.o
9ddddf35 ./src/add_slash.h
696769b6 ./src/add_slash.o
96d9b47e ./src/extcmp.c
c8cb988b ./src/main-lf.o
45c5ad37 ./src/main-lf.o
6cf0f78a ./src/extcmp.o
5cc4a5fa ./src/extcmp.h
af27f267 ./src/main-lf.c
7f3273d3 ./src/main-lf.c
5fe94b49 ./src/find_link.c
4b032edc ./src/readable-fs.o
ec228f7d ./src/color.h
29a1f82f ./src/find_link.o
27bfa6fa ./src/readable-fs.c
a5b43cf8 ./checksum.sha256sum
b863aa26 ./deps/c-utils/c-utils.c
04e33b8d ./deps/c-utils/c-utils.h
e0601357 ./deps/c-utils/c-utils.o
Expand All @@ -27,6 +29,7 @@ c02f0934 ./deps/c-utils/package.json
d781152a ./tests/11.-m_compair_with_ls_wc
ddc92836 ./tests/9.compair_with_ls_wc
abcffc7b ./tests/4.-a_option
9bb3b173 ./tests/22.one-root-file
c85f1a64 ./tests/21.broken-link
bc3aa965 ./tests/12.version_flag
40784a71 ./tests/testdata/.fileh
Expand All @@ -44,9 +47,9 @@ ee55ab06 ./tests/19.invalid_color_option
fe216666 ./tests/18.file_bytes
2d46af0e ./tests/17.link_file_test
0332e996 ./tests/20.help-test
695e0292 ./tests/7.pipe_to_wc
503a4633 ./tests/7.pipe_to_wc
49ff154a ./tests/13.unknown_flag
a2f094c6 ./tests/8.more_then_one_dir_list
ac01c29f ./tests/8.more_then_one_dir_list
75c61313 ./tests/6.force_color
0b57d9d7 ./tests/1.lf-basic
44b6b43d ./tests/16.no_perm_file_check
Expand Down
16 changes: 8 additions & 8 deletions src/main-lf.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// created by: WestleyR
// email: westleyr@nym.hush.com
// https://github.com/WestleyR/list-files
// date: Dec 8, 2019
// version-1.5.0
// date: Dec 12, 2019
// version-1.5.1
//
// The Clear BSD License
//
Expand Down Expand Up @@ -38,7 +38,7 @@
#define COMMIT_HASH "unknown"
#endif

#define SCRIPT_VERSION "v1.5.0, Dec 8, 2019"
#define SCRIPT_VERSION "v1.5.1, Dec 12, 2019"

char *base_path = NULL;

Expand Down Expand Up @@ -275,10 +275,10 @@ int max_len_files(const char* list_path, int list_all) {

struct max_list ml[10];

ml[0].uid_num = 0;
ml[0].max_uid = 0;
ml[0].pid_num = 0;
ml[0].max_pid = 0;
ml[0].uid_num = -1;
ml[0].max_uid = -1;
ml[0].pid_num = -1;
ml[0].max_pid = -1;
ml[0].end = 1;

int mindex = 0;
Expand Down Expand Up @@ -327,7 +327,7 @@ int max_len_files(const char* list_path, int list_all) {
max_grup_len = grup;
}
} else {
for (int l = 0; l < 10; l++) {
for (int l = 0; l < mindex; l++) {
if ((info.st_uid == ml[l].uid_num) && (info.st_gid == ml[l].pid_num)) {
match = 1;
break;
Expand Down
8 changes: 8 additions & 0 deletions tests/22.one-root-file
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

. ./tests-funcs

# run-test <test-name> <test-command> <expect-to-contain-output> <expect-exit-code>

run-test "lf root file" "./lf tests/testdata" "root root" "root-file" 0


2 changes: 1 addition & 1 deletion tests/7.pipe_to_wc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@

# run-test <test-name> <test-command> <expect-to-contain-output> <expect-exit-code>

run-test "lf dir dir" "./lf tests/testdata | wc -l" "9" "" 0
run-test "lf dir dir" "./lf tests/testdata | wc -l" "10" "" 0

2 changes: 1 addition & 1 deletion tests/8.more_then_one_dir_list
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@

# run-test <test-name> <test-command> <expect-to-contain-output> <expect-exit-code>

run-test "lf dir dir" "./lf tests/testdata tests/testdata | wc -l" "18" "" 0
run-test "lf dir dir" "./lf tests/testdata tests/testdata | wc -l" "20" "" 0

Empty file added tests/testdata/root-file
Empty file.

0 comments on commit 6ff5451

Please sign in to comment.