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 934cbd532d02c8fa3d513e5ecb80b0423d0bf8d0

Fix move and undo operations with broken links.
Author: xaizek
Author date (UTC): 2011-07-20 18:37
Committer name: xaizek
Committer date (UTC): 2011-07-20 18:37
Parent(s): 982d0ceb6399ab2481e09c63a05d435b55041402
Signing key:
Tree: cdb99f703184208337b6c247a23f3a0a545b535e
File Lines added Lines deleted
TODO 1 0
src/fileops.c 2 1
src/registers.c 4 1
src/undo.c 6 2
File TODO changed (mode: 100644) (index 034f614f6..dc867a1c0)
... ... Basic things that need to be done.
21 21 Backgrounding of vicmd (& at the end). Backgrounding of vicmd (& at the end).
22 22 Perform operations using system calls, not programs. This is much faster Perform operations using system calls, not programs. This is much faster
23 23 and will ease porting on Windows (less dependencies on Cygwin). and will ease porting on Windows (less dependencies on Cygwin).
24 :restore command to restore files from Trash
24 25
25 26 Documentation. Documentation.
26 27 Better documentation. Better documentation.
File src/fileops.c changed (mode: 100644) (index 46ad2a62f..6465cca66)
... ... put_next_file(const char *dest_name, int override)
1415 1415 { {
1416 1416 char *filename; char *filename;
1417 1417 char *src_buf, *dst_buf, *name_buf = NULL; char *src_buf, *dst_buf, *name_buf = NULL;
1418 struct stat st;
1418 1419
1419 1420 override = override || put_confirm.overwrite_all; override = override || put_confirm.overwrite_all;
1420 1421
 
... ... put_next_file(const char *dest_name, int override)
1422 1423 chosp(filename); chosp(filename);
1423 1424 src_buf = escape_filename(filename, 0, 0); src_buf = escape_filename(filename, 0, 0);
1424 1425 dst_buf = escape_filename(put_confirm.view->curr_dir, 0, 0); dst_buf = escape_filename(put_confirm.view->curr_dir, 0, 0);
1425 if(access(filename, F_OK) == 0 && src_buf != NULL && dst_buf != NULL)
1426 if(lstat(filename, &st) == 0 && src_buf != NULL && dst_buf != NULL)
1426 1427 { {
1427 1428 char do_buf[PATH_MAX + NAME_MAX*2 + 4]; char do_buf[PATH_MAX + NAME_MAX*2 + 4];
1428 1429 char undo_buf[PATH_MAX + NAME_MAX*2 + 4]; char undo_buf[PATH_MAX + NAME_MAX*2 + 4];
File src/registers.c changed (mode: 100644) (index 24945e03a..25d2b9aa9)
16 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
17 17 */ */
18 18
19 #include <sys/stat.h>
20 #include <sys/types.h>
19 21 #include <unistd.h> #include <unistd.h>
20 22
21 23 #include <string.h> #include <string.h>
 
... ... void
79 81 append_to_register(int key, char *file) append_to_register(int key, char *file)
80 82 { {
81 83 registers_t *reg; registers_t *reg;
84 struct stat st;
82 85
83 86 if((reg = find_register(key)) == NULL) if((reg = find_register(key)) == NULL)
84 87 return; return;
85 88
86 if(access(file, F_OK))
89 if(lstat(file, &st) != 0)
87 90 return; return;
88 91
89 92 if(check_for_duplicate_file_names(reg, file)) if(check_for_duplicate_file_names(reg, file))
File src/undo.c changed (mode: 100644) (index 69e2ff442..eb08d1e47)
1 #include <sys/stat.h>
2 #include <sys/types.h>
1 3 #include <unistd.h> #include <unistd.h>
2 4
3 5 #include <assert.h> #include <assert.h>
 
... ... is_redo_group_possible(void)
402 404 static int static int
403 405 is_op_possible(const struct op_t *op) is_op_possible(const struct op_t *op)
404 406 { {
405 if(op->src != NULL && access(op->src, F_OK) != 0)
407 struct stat st;
408
409 if(op->src != NULL && lstat(op->src, &st) != 0)
406 410 return 0; return 0;
407 if(op->dst != NULL && access(op->dst, F_OK) == 0)
411 if(op->dst != NULL && lstat(op->dst, &st) == 0)
408 412 { {
409 413 if(strncmp(op->dst, cfg.trash_dir, trash_dir_len) == 0) if(strncmp(op->dst, cfg.trash_dir, trash_dir_len) == 0)
410 414 return -1; return -1;
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