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 940ff3c983f91bc51cc50a1b20def5d721358212

Add checks for :mkdir as for :touch
Name duplication.
Empty name.
File existence.
Author: xaizek
Author date (UTC): 2011-11-13 18:57
Committer name: xaizek
Committer date (UTC): 2011-11-13 18:57
Parent(s): 919ccc18cbb53a1699a9761d18bc562b2c60a038
Signing key:
Tree: 36210bc8639223d50350a61bf57be5773b2b57c9
File Lines added Lines deleted
src/fileops.c 21 1
File src/fileops.c changed (mode: 100644) (index 4ec37773c..1086d4251)
... ... make_dirs(FileView *view, char **names, int count, int create_parent)
3569 3569 int n; int n;
3570 3570 void *cp = (void *)(long)create_parent; void *cp = (void *)(long)create_parent;
3571 3571
3572 for(i = 0; i < count; i++)
3573 {
3574 struct stat st;
3575 if(is_in_string_array(names, i, names[i]))
3576 {
3577 status_bar_errorf("Name \"%s\" duplicates", names[i]);
3578 return;
3579 }
3580 if(names[i][0] == '\0')
3581 {
3582 status_bar_errorf("Name #%d is empty", i + 1);
3583 return;
3584 }
3585 if(lstat(names[i], &st) == 0)
3586 {
3587 status_bar_errorf("File \"%s\" already exists", names[i]);
3588 return;
3589 }
3590 }
3591
3572 3592 snprintf(buf, sizeof(buf), "mkdir in %s: ", snprintf(buf, sizeof(buf), "mkdir in %s: ",
3573 3593 replace_home_part(view->curr_dir)); replace_home_part(view->curr_dir));
3574 3594
 
... ... make_files(FileView *view, char **names, int count)
3616 3636 } }
3617 3637 if(names[i][0] == '\0') if(names[i][0] == '\0')
3618 3638 { {
3619 status_bar_error("One of names is empty");
3639 status_bar_errorf("Name #%d is empty", i + 1);
3620 3640 return 1; return 1;
3621 3641 } }
3622 3642 if(strchr(names[i], '/') != NULL) if(strchr(names[i], '/') != NULL)
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