Merge branch '2874_tilde_directory'
* 2874_tilde_directory: Allow create directory with name '~' (tilda). Reimplement support of use ~ as home directory in hotlist. Ticket #2874: enter on directory named '~' goes to the home one.
Этот коммит содержится в:
Коммит
ded2b30443
@ -152,16 +152,11 @@ vfs_canon (const char *path)
|
||||
}
|
||||
else
|
||||
{
|
||||
local = tilde_expand (path);
|
||||
if (*local != PATH_SEP)
|
||||
{
|
||||
char *curr_dir;
|
||||
char *curr_dir;
|
||||
|
||||
g_free (local);
|
||||
curr_dir = vfs_get_current_dir ();
|
||||
local = mc_build_filename (curr_dir, path, NULL);
|
||||
g_free (curr_dir);
|
||||
}
|
||||
curr_dir = vfs_get_current_dir ();
|
||||
local = mc_build_filename (curr_dir, path, NULL);
|
||||
g_free (curr_dir);
|
||||
}
|
||||
result = vfs_canon (local);
|
||||
g_free (local);
|
||||
|
@ -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)
|
||||
|
@ -1437,7 +1437,7 @@ hot_load_group (struct hotlist *grp)
|
||||
label = g_strdup (tkn_buf->str);
|
||||
CHECK_TOKEN (TKN_URL);
|
||||
CHECK_TOKEN (TKN_STRING);
|
||||
url = g_strdup (tkn_buf->str);
|
||||
url = tilde_expand (tkn_buf->str);
|
||||
add2hotlist (label, url, HL_TYPE_ENTRY, LISTBOX_APPEND_AT_END);
|
||||
SKIP_TO_EOL;
|
||||
}
|
||||
@ -1491,7 +1491,7 @@ hot_load_file (struct hotlist *grp)
|
||||
label = g_strdup (tkn_buf->str);
|
||||
CHECK_TOKEN (TKN_URL);
|
||||
CHECK_TOKEN (TKN_STRING);
|
||||
url = g_strdup (tkn_buf->str);
|
||||
url = tilde_expand (tkn_buf->str);
|
||||
add2hotlist (label, url, HL_TYPE_ENTRY, LISTBOX_APPEND_AT_END);
|
||||
SKIP_TO_EOL;
|
||||
}
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user