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 48cb525b0fbade237f73d2370da3c23e2682f6ab

Fix app GUI subsys on Windows for path w/ spaces
Author: xaizek
Author date (UTC): 2014-04-21 11:04
Committer name: xaizek
Committer date (UTC): 2014-04-21 11:04
Parent(s): ddeda744aa204177cea79331d1bfc3986c7c68ad
Signing key:
Tree: 436d2d934c9b8c1cbcfd64595d8e1a1e402cf21e
File Lines added Lines deleted
ChangeLog 3 0
src/running.c 8 4
src/utils/utils_win.h 4 3
File ChangeLog changed (mode: 100644) (index 45e5df55d..0aa8ed860)
175 175 Fixed work with filenames contining special symbols on Windows with cmd.exe Fixed work with filenames contining special symbols on Windows with cmd.exe
176 176 shell. Thanks to Daniel Polanco, a.k.a. dlpolanco. shell. Thanks to Daniel Polanco, a.k.a. dlpolanco.
177 177
178 Fixed testing whether application uses GUI on Windows when path contains
179 spaces.
180
178 181 0.7.6-beta2 to 0.7.6 0.7.6-beta2 to 0.7.6
179 182
180 183 Removed check for stdscr from the configure. Thanks to jtbm37. Removed check for stdscr from the configure. Thanks to jtbm37.
File src/running.c changed (mode: 100644) (index b19f5c6ab..ff78fdb35)
... ... static void run_win_executable(char full_path[]);
71 71 static int run_win_executable_as_evaluated(const char full_path[]); static int run_win_executable_as_evaluated(const char full_path[]);
72 72 #endif #endif
73 73 static int selection_is_consistent(const FileView *const view); static int selection_is_consistent(const FileView *const view);
74 static void execute_file(char full_path[]);
74 static void execute_file(const char full_path[]);
75 75 static void run_selection(FileView *view, int dont_execute); static void run_selection(FileView *view, int dont_execute);
76 76 static void run_file(FileView *view, int dont_execute); static void run_file(FileView *view, int dont_execute);
77 77 static int multi_run_compat(FileView *view, const char *program); static int multi_run_compat(FileView *view, const char *program);
 
... ... selection_is_consistent(const FileView *const view)
297 297 /* Executes file, specified by the full_path. Changes type of slashes on /* Executes file, specified by the full_path. Changes type of slashes on
298 298 * Windows. */ * Windows. */
299 299 static void static void
300 execute_file(char full_path[])
300 execute_file(const char full_path[])
301 301 { {
302 302 #ifndef _WIN32 #ifndef _WIN32
303 303 char *const escaped = escape_filename(full_path, 0); char *const escaped = escape_filename(full_path, 0);
304 304 shellout(escaped, 1, 1); shellout(escaped, 1, 1);
305 305 free(escaped); free(escaped);
306 306 #else #else
307 to_back_slash(full_path);
308 run_win_executable(full_path);
307 char *const dquoted_full_path = strdup(enclose_in_dquotes(full_path));
308
309 to_back_slash(dquoted_full_path);
310 run_win_executable(dquoted_full_path);
311
312 free(dquoted_full_path);
309 313 #endif #endif
310 314 } }
311 315
File src/utils/utils_win.h changed (mode: 100644) (index 78acdcc87..51c53b7bb)
... ... int wcwidth(wchar_t c);
44 44
45 45 int wcswidth(const wchar_t str[], size_t max_len); int wcswidth(const wchar_t str[], size_t max_len);
46 46
47 /* Executes a command (cmd) using CreateProcess() API function. On internal
48 * error returns last error code and sets *returned_exit_code to zero, otherwise
49 * sets *returned_exit_code to non-zero and returns exit code of a process. */
47 /* Executes a command (cmd) using CreateProcess() API function. Expects path
48 * that contain spaces to be enclosed in double quotes. On internal error
49 * returns last error code and sets *returned_exit_code to zero, otherwise sets
50 * *returned_exit_code to non-zero and returns exit code of a process. */
50 51 int win_exec_cmd(char cmd[], int *const returned_exit_code); int win_exec_cmd(char cmd[], int *const returned_exit_code);
51 52
52 53 /* Checks executable existence trying to add executable extensions if needed. */ /* Checks executable existence trying to add executable extensions if needed. */
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