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 0214a249363577f98e56ffac678f2bd8cf2de176

Fix navigation to menu items with full path on Win
Thanks to Robert Sarkozi.
Author: xaizek
Author date (UTC): 2014-05-06 20:12
Committer name: xaizek
Committer date (UTC): 2014-05-06 20:12
Parent(s): 80294b7eeffa153b8e896e4dfc2022411adc2da9
Signing key:
Tree: 7d33b021867db60248ce4988c6b086407d0e26a1
File Lines added Lines deleted
ChangeLog 3 0
src/menus/menus.c 9 1
tests/misc/parse_spec.c 26 0
File ChangeLog changed (mode: 100644) (index 0a8b754e3..1b467ccc1)
7 7
8 8 Fixed processing of backward slashes in menus with filelists on Windows. Fixed processing of backward slashes in menus with filelists on Windows.
9 9
10 Fixed navigation to menu items with full paths on Windows. Thanks to
11 Robert Sarkozi.
12
10 13 0.7.6 to 0.7.7-beta 0.7.6 to 0.7.7-beta
11 14
12 15 Added Ctrl-W z key to normal and view modes, which closes preview pane or Added Ctrl-W z key to normal and view modes, which closes preview pane or
File src/menus/menus.c changed (mode: 100644) (index 71c04713d..5fa0586fe)
... ... parse_spec(const char spec[], int *line_num)
493 493 { {
494 494 char *path_buf; char *path_buf;
495 495 const char *colon; const char *colon;
496 int colon_lookup_offset = 0;
496 497 const size_t bufs_len = 2 + strlen(spec) + 1 + 1; const size_t bufs_len = 2 + strlen(spec) + 1 + 1;
497 498
498 499 path_buf = malloc(bufs_len); path_buf = malloc(bufs_len);
 
... ... parse_spec(const char spec[], int *line_num)
510 511 copy_str(path_buf, bufs_len, "./"); copy_str(path_buf, bufs_len, "./");
511 512 } }
512 513
513 colon = strchr(spec, ':');
514 #ifdef _WIN32
515 if(is_path_absolute(spec))
516 {
517 colon_lookup_offset = 2;
518 }
519 #endif
520
521 colon = strchr(spec + colon_lookup_offset, ':');
514 522 if(colon != NULL) if(colon != NULL)
515 523 { {
516 524 strncat(path_buf, spec, colon - spec); strncat(path_buf, spec, colon - spec);
File tests/misc/parse_spec.c changed (mode: 100644) (index a05ef5163..d7752864e)
... ... test_relative_path_with_linenum(void)
80 80
81 81 #ifdef _WIN32 #ifdef _WIN32
82 82
83 static void
84 test_win_absolute_path_without_linenum(void)
85 {
86 int line_num;
87 char *const path = parse_spec("c:/home/user", &line_num);
88
89 assert_string_equal("c:/home/user", path);
90 assert_int_equal(DEFAULT_LINENUM, line_num);
91
92 free(path);
93 }
94
95 static void
96 test_win_absolute_path_with_linenum(void)
97 {
98 int line_num;
99 char *const path = parse_spec("c:/home/user:1234", &line_num);
100
101 assert_string_equal("c:/home/user", path);
102 assert_int_equal(1234, line_num);
103
104 free(path);
105 }
106
83 107 static void static void
84 108 test_win_relative_path_without_linenum(void) test_win_relative_path_without_linenum(void)
85 109 { {
 
... ... parse_spec_tests(void)
118 142 run_test(test_relative_path_without_linenum); run_test(test_relative_path_without_linenum);
119 143 run_test(test_relative_path_with_linenum); run_test(test_relative_path_with_linenum);
120 144 #ifdef _WIN32 #ifdef _WIN32
145 run_test(test_win_absolute_path_without_linenum);
146 run_test(test_win_absolute_path_with_linenum);
121 147 run_test(test_win_relative_path_without_linenum); run_test(test_win_relative_path_without_linenum);
122 148 run_test(test_win_relative_path_with_linenum); run_test(test_win_relative_path_with_linenum);
123 149 #endif #endif
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