mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
Allow create directory with name '~' (tilda).
Use escaping for that (as in shell): \~. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
85ed2bd331
commit
513d30e5a1
@ -895,16 +895,23 @@ mkdir_cmd (void)
|
||||
input_expand_dialog (_("Create a new Directory"),
|
||||
_("Enter directory name:"), MC_HISTORY_FM_MKDIR, name);
|
||||
|
||||
if (!dir)
|
||||
return;
|
||||
|
||||
if (*dir)
|
||||
if (dir != NULL && dir != '\0')
|
||||
{
|
||||
vfs_path_t *absdir;
|
||||
|
||||
if (dir[0] == '/' || dir[0] == '~')
|
||||
absdir = vfs_path_from_str (dir);
|
||||
else
|
||||
absdir = vfs_path_append_new (current_panel->cwd_vpath, dir, NULL);
|
||||
{
|
||||
/* possible escaped '~' */
|
||||
/* allow create directory with name '~' */
|
||||
char *tmpdir = dir;
|
||||
|
||||
if (dir[0] == '\\' && dir[1] == '~')
|
||||
tmpdir = dir + 1;
|
||||
|
||||
absdir = vfs_path_append_new (current_panel->cwd_vpath, tmpdir, NULL);
|
||||
}
|
||||
|
||||
save_cwds_stat ();
|
||||
if (my_mkdir (absdir, 0777) == 0)
|
||||
|
Loading…
Reference in New Issue
Block a user