| File ChangeLog changed (mode: 100644) (index 3f5d77335..07d457cb1) |
| 5 |
5 |
Fixed ga and gA on symlinks to directories on their own (regression in |
Fixed ga and gA on symlinks to directories on their own (regression in |
| 6 |
6 |
0.11-beta) and as part of selection. Thanks to filterfalse. |
0.11-beta) and as part of selection. Thanks to filterfalse. |
| 7 |
7 |
|
|
|
8 |
|
Fixed an issue with undesired cache invalidation for symbolic link to |
|
9 |
|
directories, which caused performance issue (regression in 0.11-beta). |
|
10 |
|
|
| 8 |
11 |
0.10.1 to 0.11-beta (2020-09-10) |
0.10.1 to 0.11-beta (2020-09-10) |
| 9 |
12 |
|
|
| 10 |
13 |
Added :VifmCs command to the plugin for "converting" Vim's color scheme |
Added :VifmCs command to the plugin for "converting" Vim's color scheme |
| File src/filelist.c changed (mode: 100644) (index f41ade678..5121fadd9) |
| ... |
... |
recalc_entry_size(const dir_entry_t *entry, uint64_t old_size) |
| 1583 |
1583 |
static uint64_t |
static uint64_t |
| 1584 |
1584 |
entry_calc_nitems(const dir_entry_t *entry) |
entry_calc_nitems(const dir_entry_t *entry) |
| 1585 |
1585 |
{ |
{ |
| 1586 |
|
uint64_t ret; |
|
| 1587 |
1586 |
char full_path[PATH_MAX + 1]; |
char full_path[PATH_MAX + 1]; |
| 1588 |
1587 |
get_full_path_of(entry, sizeof(full_path), full_path); |
get_full_path_of(entry, sizeof(full_path), full_path); |
| 1589 |
1588 |
|
|
| 1590 |
|
uint64_t inode = DCACHE_UNKNOWN; |
|
| 1591 |
|
#ifndef _WIN32 |
|
| 1592 |
|
inode = entry->inode; |
|
| 1593 |
|
#endif |
|
|
1589 |
|
uint64_t ret = count_dir_items(full_path); |
| 1594 |
1590 |
|
|
| 1595 |
|
ret = count_dir_items(full_path); |
|
|
1591 |
|
uint64_t inode = get_true_inode(entry); |
| 1596 |
1592 |
dcache_set_at(full_path, inode, DCACHE_UNKNOWN, ret); |
dcache_set_at(full_path, inode, DCACHE_UNKNOWN, ret); |
| 1597 |
1593 |
|
|
| 1598 |
1594 |
return ret; |
return ret; |
| File src/status.c changed (mode: 100644) (index 26091e75f..1cfd9995f) |
| ... |
... |
dcache_get_of(const dir_entry_t *entry, dcache_result_t *size, |
| 573 |
573 |
char full_path[PATH_MAX + 1]; |
char full_path[PATH_MAX + 1]; |
| 574 |
574 |
get_full_path_of(entry, sizeof(full_path), full_path); |
get_full_path_of(entry, sizeof(full_path), full_path); |
| 575 |
575 |
|
|
| 576 |
|
uint64_t inode = 0; |
|
| 577 |
|
#ifndef _WIN32 |
|
| 578 |
|
inode = entry->inode; |
|
| 579 |
|
#endif |
|
|
576 |
|
uint64_t inode = get_true_inode(entry); |
| 580 |
577 |
dcache_get(full_path, entry->mtime, inode, size, nitems); |
dcache_get(full_path, entry->mtime, inode, size, nitems); |
| 581 |
578 |
} |
} |
| 582 |
579 |
|
|
| File src/utils/utils_nix.c changed (mode: 100644) (index d23a237ea..cb6c176ee) |
| 59 |
59 |
#include "../compat/reallocarray.h" |
#include "../compat/reallocarray.h" |
| 60 |
60 |
#include "../ui/tabs.h" |
#include "../ui/tabs.h" |
| 61 |
61 |
#include "../ui/ui.h" |
#include "../ui/ui.h" |
|
62 |
|
#include "../filelist.h" |
| 62 |
63 |
#include "../running.h" |
#include "../running.h" |
| 63 |
64 |
#include "../status.h" |
#include "../status.h" |
| 64 |
65 |
#include "cancellation.h" |
#include "cancellation.h" |
| |
| ... |
... |
get_free_space(const char at[]) |
| 1160 |
1161 |
#endif |
#endif |
| 1161 |
1162 |
} |
} |
| 1162 |
1163 |
|
|
|
1164 |
|
uint64_t |
|
1165 |
|
get_true_inode(const struct dir_entry_t *entry) |
|
1166 |
|
{ |
|
1167 |
|
if(entry->type != FT_LINK) |
|
1168 |
|
{ |
|
1169 |
|
return entry->inode; |
|
1170 |
|
} |
|
1171 |
|
|
|
1172 |
|
char full_path[PATH_MAX + 1]; |
|
1173 |
|
get_full_path_of(entry, sizeof(full_path), full_path); |
|
1174 |
|
|
|
1175 |
|
struct stat s; |
|
1176 |
|
if(os_stat(full_path, &s) == 0) |
|
1177 |
|
{ |
|
1178 |
|
return s.st_ino; |
|
1179 |
|
} |
|
1180 |
|
return entry->inode; |
|
1181 |
|
} |
|
1182 |
|
|
| 1163 |
1183 |
/* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ |
/* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */ |
| 1164 |
1184 |
/* vim: set cinoptions+=t0 filetype=c : */ |
/* vim: set cinoptions+=t0 filetype=c : */ |
| File tests/misc/dcache.c changed (mode: 100644) (index f5e56cd75..67ed8a983) |
| 1 |
1 |
#include <stic.h> |
#include <stic.h> |
| 2 |
2 |
|
|
|
3 |
|
#include <unistd.h> /* symlink() */ |
|
4 |
|
|
| 3 |
5 |
#include <stddef.h> /* NULL */ |
#include <stddef.h> /* NULL */ |
| 4 |
6 |
#include <string.h> /* memset() strcpy() */ |
#include <string.h> /* memset() strcpy() */ |
| 5 |
7 |
#include <time.h> /* time() */ |
#include <time.h> /* time() */ |
| |
| 7 |
9 |
#include <test-utils.h> |
#include <test-utils.h> |
| 8 |
10 |
|
|
| 9 |
11 |
#include "../../src/cfg/config.h" |
#include "../../src/cfg/config.h" |
|
12 |
|
#include "../../src/compat/os.h" |
| 10 |
13 |
#include "../../src/ui/ui.h" |
#include "../../src/ui/ui.h" |
| 11 |
14 |
#include "../../src/utils/str.h" |
#include "../../src/utils/str.h" |
| 12 |
15 |
#include "../../src/status.h" |
#include "../../src/status.h" |
| |
| ... |
... |
TEST(outdated_data_is_detected) |
| 74 |
77 |
TEST(can_query_one_parameter_at_a_time) |
TEST(can_query_one_parameter_at_a_time) |
| 75 |
78 |
{ |
{ |
| 76 |
79 |
dcache_result_t data; |
dcache_result_t data; |
| 77 |
|
dir_entry_t entry = { .name = "read", .origin = TEST_DATA_PATH }; |
|
|
80 |
|
dir_entry_t entry = { |
|
81 |
|
.name = "read", .origin = TEST_DATA_PATH, .type = FT_DIR |
|
82 |
|
}; |
| 78 |
83 |
|
|
| 79 |
84 |
dcache_set_at(TEST_DATA_PATH "/read", 0, 10, 11); |
dcache_set_at(TEST_DATA_PATH "/read", 0, 10, 11); |
| 80 |
85 |
|
|
| |
| ... |
... |
TEST(can_query_one_parameter_at_a_time) |
| 89 |
94 |
|
|
| 90 |
95 |
#ifndef _WIN32 |
#ifndef _WIN32 |
| 91 |
96 |
|
|
|
97 |
|
TEST(symlink_inode_resolution, IF(not_windows)) |
|
98 |
|
{ |
|
99 |
|
dir_entry_t link_entry = { |
|
100 |
|
.name = "link", .origin = SANDBOX_PATH, .type = FT_LINK, |
|
101 |
|
}; |
|
102 |
|
|
|
103 |
|
create_dir(SANDBOX_PATH "/dir"); |
|
104 |
|
|
|
105 |
|
struct stat s; |
|
106 |
|
assert_success(os_stat(SANDBOX_PATH "/dir", &s)); |
|
107 |
|
|
|
108 |
|
assert_success(symlink("dir", SANDBOX_PATH "/link")); |
|
109 |
|
|
|
110 |
|
dcache_set_at(SANDBOX_PATH "/dir", s.st_ino, 10, DCACHE_UNKNOWN); |
|
111 |
|
|
|
112 |
|
dcache_result_t data; |
|
113 |
|
dcache_get_of(&link_entry, &data, NULL); |
|
114 |
|
assert_true(data.is_valid); |
|
115 |
|
assert_ulong_equal(10, data.value); |
|
116 |
|
|
|
117 |
|
remove_file(SANDBOX_PATH "/link"); |
|
118 |
|
remove_dir(SANDBOX_PATH "/dir"); |
|
119 |
|
} |
|
120 |
|
|
| 92 |
121 |
TEST(inode_is_taken_into_account) |
TEST(inode_is_taken_into_account) |
| 93 |
122 |
{ |
{ |
| 94 |
123 |
dcache_result_t size, nitems; |
dcache_result_t size, nitems; |
| 95 |
124 |
|
|
| 96 |
|
dir_entry_t entry = { .name = "read", .origin = TEST_DATA_PATH, .inode = 1 }; |
|
|
125 |
|
dir_entry_t entry = { |
|
126 |
|
.name = "read", .origin = TEST_DATA_PATH, .inode = 1, .type = FT_DIR |
|
127 |
|
}; |
| 97 |
128 |
|
|
| 98 |
129 |
dcache_set_at(TEST_DATA_PATH "/read", 1, 10, 11); |
dcache_set_at(TEST_DATA_PATH "/read", 1, 10, 11); |
| 99 |
130 |
|
|