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 446be6d5b47f53669c6e99678d4db9bfe3dff902

Don't try to open broken links with l and :e.
Author: xaizek
Author date (UTC): 2011-07-20 19:07
Committer name: xaizek
Committer date (UTC): 2011-07-20 19:07
Parent(s): 4abacfe2521d02fe753101304adb19aec8c6f9b1
Signing key:
Tree: 5663aff44bb6285498fdcb9e1532ef6b4e888db0
File Lines added Lines deleted
src/commands.c 1 10
src/fileops.c 19 1
src/fileops.h 1 0
File src/commands.c changed (mode: 100644) (index c7c2c764c..834451886)
... ... execute_builtin_command(FileView *view, cmd_params *cmd)
1690 1690 } }
1691 1691 if(!view->selected_files || !view->dir_entry[view->list_pos].selected) if(!view->selected_files || !view->dir_entry[view->list_pos].selected)
1692 1692 { {
1693 char buf[PATH_MAX];
1694 if(view->dir_entry[view->list_pos].name != NULL)
1695 {
1696 char *escaped =
1697 escape_filename(view->dir_entry[view->list_pos].name, 0, 0);
1698 snprintf(buf, sizeof(buf), "%s %s/%s", cfg.vi_command,
1699 view->curr_dir, escaped);
1700 free(escaped);
1701 shellout(buf, -1);
1702 }
1693 view_file(get_current_file_name(view));
1703 1694 } }
1704 1695 else else
1705 1696 { {
File src/fileops.c changed (mode: 100644) (index 6465cca66..c713cf2e9)
... ... file_exec(char *command)
267 267 return pid; return pid;
268 268 } }
269 269
270 static void
270 void
271 271 view_file(const char *filename) view_file(const char *filename)
272 272 { {
273 273 char command[PATH_MAX + 5] = ""; char command[PATH_MAX + 5] = "";
274 274 char *escaped; char *escaped;
275 275
276 if(access(filename, F_OK) != 0)
277 {
278 show_error_msg("Broken Link", "Link destination doesn't exist");
279 return;
280 }
281
276 282 escaped = escape_filename(filename, 0, 0); escaped = escape_filename(filename, 0, 0);
277 283 snprintf(command, sizeof(command), "%s %s", cfg.vi_command, escaped); snprintf(command, sizeof(command), "%s %s", cfg.vi_command, escaped);
278 284 free(escaped); free(escaped);
 
... ... execute_file(FileView *view, int dont_execute)
548 554 { {
549 555 char *program; char *program;
550 556
557 if(access(view->dir_entry[view->list_pos].name, F_OK) != 0)
558 {
559 show_error_msg("Broken Link", "Link destination doesn't exist");
560 return;
561 }
562
551 563 /* Check for a filetype */ /* Check for a filetype */
552 564 /* vi is set as the default for any extension without a program */ /* vi is set as the default for any extension without a program */
553 565 if((program = get_default_program_for_file( if((program = get_default_program_for_file(
 
... ... run_using_prog(FileView *view, const char *program, int dont_execute,
569 581 if(pause) if(pause)
570 582 program += 2; program += 2;
571 583
584 if(access(view->dir_entry[view->list_pos].name, F_OK) != 0)
585 {
586 show_error_msg("Broken Link", "Link destination doesn't exist");
587 return;
588 }
589
572 590 if(strncmp(program, "FUSE_MOUNT", 10) == 0 if(strncmp(program, "FUSE_MOUNT", 10) == 0
573 591 || strncmp(program, "FUSE_MOUNT2", 11) == 0) || strncmp(program, "FUSE_MOUNT2", 11) == 0)
574 592 { {
File src/fileops.h changed (mode: 100644) (index 53aac92ce..10faa1623)
... ... void run_using_prog(FileView *view, const char *program, int dont_execute,
50 50 int yank_files(FileView *view, int reg, int count, int *indexes); int yank_files(FileView *view, int reg, int count, int *indexes);
51 51 void yank_selected_files(FileView *view, int reg); void yank_selected_files(FileView *view, int reg);
52 52 int file_exec(char *command); int file_exec(char *command);
53 void view_file(const char *filename);
53 54 void show_change_window(FileView *view, int type); void show_change_window(FileView *view, int type);
54 55 void rename_file(FileView *view, int name_only); void rename_file(FileView *view, int name_only);
55 56 void rename_files(FileView *view); void rename_files(FileView *view);
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