mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 12:32:40 +03:00
Merge branch '3093_keep_symlink_cwd_startup_fix'
* 3093_keep_symlink_cwd_startup_fix: Ticket #3093: fix sefault in case of run "mcedit relative/path/to/file".
This commit is contained in:
commit
e65954d5b0
43
src/main.c
43
src/main.c
@ -293,13 +293,35 @@ main (int argc, char *argv[])
|
||||
vfs_init ();
|
||||
vfs_plugins_init ();
|
||||
|
||||
load_setup ();
|
||||
|
||||
/* Must be done after load_setup because depends on mc_global.vfs.cd_symlinks */
|
||||
vfs_setup_work_dir ();
|
||||
|
||||
/* Resolve the other_dir panel option. Must be done after vfs_setup_work_dir */
|
||||
{
|
||||
char *buffer;
|
||||
vfs_path_t *vpath;
|
||||
|
||||
buffer = mc_config_get_string (mc_panels_config, "Dirs", "other_dir", ".");
|
||||
vpath = vfs_path_from_str (buffer);
|
||||
if (vfs_file_is_local (vpath))
|
||||
saved_other_dir = buffer;
|
||||
else
|
||||
g_free (buffer);
|
||||
vfs_path_free (vpath);
|
||||
}
|
||||
|
||||
/* Set up temporary directory after VFS initialization */
|
||||
mc_tmpdir ();
|
||||
|
||||
/* do this after vfs initialization due to mc_setctl() call in mc_setup_by_args() */
|
||||
/* do this after vfs initialization and vfs working directory setup
|
||||
due to mc_setctl() and mcedit_arg_vpath_new() calls in mc_setup_by_args() */
|
||||
if (!mc_setup_by_args (argc, argv, &error))
|
||||
{
|
||||
vfs_shut ();
|
||||
done_setup ();
|
||||
g_free (saved_other_dir);
|
||||
mc_event_deinit (NULL);
|
||||
goto startup_exit_falure;
|
||||
}
|
||||
@ -337,25 +359,6 @@ main (int argc, char *argv[])
|
||||
/* FIXME: Should be removed and LINES and COLS computed on subshell */
|
||||
tty_init (!mc_args__nomouse, mc_global.tty.xterm_flag);
|
||||
|
||||
load_setup ();
|
||||
|
||||
/* Must be done after load_setup because depends on mc_global.vfs.cd_symlinks */
|
||||
vfs_setup_work_dir ();
|
||||
|
||||
/* Resolve the other_dir panel option. Must be done after vfs_setup_work_dir */
|
||||
{
|
||||
char *buffer;
|
||||
vfs_path_t *vpath;
|
||||
|
||||
buffer = mc_config_get_string (mc_panels_config, "Dirs", "other_dir", ".");
|
||||
vpath = vfs_path_from_str (buffer);
|
||||
if (vfs_file_is_local (vpath))
|
||||
saved_other_dir = buffer;
|
||||
else
|
||||
g_free (buffer);
|
||||
vfs_path_free (vpath);
|
||||
}
|
||||
|
||||
/* start check mc_global.display_codepage and mc_global.source_codepage */
|
||||
check_codeset ();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user