xaizek / vifm (License: GPLv2+) (since 2018-12-07)
Vifm is a file manager with curses interface, which provides Vi[m]-like environment for managing objects within file systems, extended with some useful ideas from mutt.
Commit 289416bd45e8294746abf73db99e91f0b27f6226

Fix ga and gA on symlinks to directories
On their own (regression in 0.11-beta) and as part of selection.

Thanks to filterfalse.
Author: xaizek
Author date (UTC): 2020-09-14 12:08
Committer name: xaizek
Committer date (UTC): 2020-09-14 13:40
Parent(s): 809b84a5905c68855fc221f06d130254a4c9f153
Signing key: 99DC5E4DB05F6BE2
Tree: dbc2ee68fcf9b175b171b93d4d64af444d7e6d68
File Lines added Lines deleted
ChangeLog 3 0
src/fops_misc.c 1 1
tests/fileops/size.c 33 1
File ChangeLog changed (mode: 100644) (index 902b1624d..3f5d77335)
2 2
3 3 Recommend against setting 'shellcmdflag' to "-ic" value. Recommend against setting 'shellcmdflag' to "-ic" value.
4 4
5 Fixed ga and gA on symlinks to directories on their own (regression in
6 0.11-beta) and as part of selection. Thanks to filterfalse.
7
5 8 0.10.1 to 0.11-beta (2020-09-10) 0.10.1 to 0.11-beta (2020-09-10)
6 9
7 10 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/fops_misc.c changed (mode: 100644) (index ef6e499bb..8c4cfb2b4)
... ... fops_size_bg(view_t *view, int force)
1076 1076 static void static void
1077 1077 update_dir_entry_size(dir_entry_t *entry, int force) update_dir_entry_size(dir_entry_t *entry, int force)
1078 1078 { {
1079 if(fentry_is_fake(entry) || entry->type != FT_DIR)
1079 if(fentry_is_fake(entry) || !fentry_is_dir(entry))
1080 1080 { {
1081 1081 return; return;
1082 1082 } }
File tests/fileops/size.c changed (mode: 100644) (index efe518a50..1408a4cda)
1 1 #include <stic.h> #include <stic.h>
2 2
3 3 #include <sys/stat.h> /* stat */ #include <sys/stat.h> /* stat */
4 #include <unistd.h> /* rmdir() unlink() */
4 #include <unistd.h> /* rmdir() symlink() unlink() */
5 5
6 6 #include <string.h> /* strcpy() strdup() */ #include <string.h> /* strcpy() strdup() */
7 7 #include <time.h> /* time_t */ #include <time.h> /* time_t */
8 8
9 9 #include "../../src/cfg/config.h" #include "../../src/cfg/config.h"
10 #include "../../src/compat/fs_limits.h"
10 11 #include "../../src/compat/os.h" #include "../../src/compat/os.h"
11 12 #include "../../src/utils/dynarray.h" #include "../../src/utils/dynarray.h"
13 #include "../../src/utils/fs.h"
12 14 #include "../../src/filelist.h" #include "../../src/filelist.h"
13 15 #include "../../src/fops_misc.h" #include "../../src/fops_misc.h"
14 16 #include "../../src/status.h" #include "../../src/status.h"
 
... ... TEST(changed_directory_detected_on_size_calculation, IF(not_windows))
79 81 assert_success(rmdir(SANDBOX_PATH "/dir")); assert_success(rmdir(SANDBOX_PATH "/dir"));
80 82 } }
81 83
84 TEST(symlinks_to_dirs, IF(not_windows))
85 {
86 create_empty_dir(SANDBOX_PATH "/dir");
87
88 char cwd[PATH_MAX + 1];
89 get_cwd(cwd, sizeof(cwd));
90 char dir[PATH_MAX + 1];
91 make_abs_path(dir, sizeof(dir), TEST_DATA_PATH, "various-sizes", cwd);
92 /* symlink() is not available on Windows, but the rest of the code is fine. */
93 #ifndef _WIN32
94 assert_success(symlink(dir, SANDBOX_PATH "/link"));
95 #endif
96
97 view_setup(&lwin);
98 set_to_sandbox_path(lwin.curr_dir, sizeof(lwin.curr_dir));
99 populate_dir_list(&lwin, 0);
100 assert_int_equal(2, lwin.list_rows);
101 lwin.dir_entry[0].marked = 1;
102 lwin.dir_entry[1].marked = 1;
103 lwin.pending_marking = 1;
104
105 fops_size_bg(&lwin, 0);
106 assert_int_equal(0, wait_for_size(SANDBOX_PATH "/dir"));
107 assert_int_equal(73728, wait_for_size(SANDBOX_PATH "/link"));
108
109 view_teardown(&lwin);
110 assert_success(unlink(SANDBOX_PATH "/link"));
111 assert_success(rmdir(SANDBOX_PATH "/dir"));
112 }
113
82 114 static void static void
83 115 setup_single_entry(view_t *view, const char name[]) setup_single_entry(view_t *view, const char name[])
84 116 { {
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/vifm

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/vifm

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master