Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- ../mc-4.8.19.orig/src/setup.h 2017-03-05 01:51:39.000000000 +0800
- +++ src/setup.h 2018-02-05 18:24:54.884665367 +0800
- @@ -117,6 +117,9 @@
- extern char *spell_language;
- #endif
- +/* Value of "current_dir" key in ini file */
- +extern char *saved_current_dir;
- +
- /* Value of "other_dir" key in ini file */
- extern char *saved_other_dir;
- --- ../mc-4.8.19.orig/src/setup.c 2017-03-05 01:51:39.000000000 +0800
- +++ src/setup.c 2018-02-05 18:11:14.352771282 +0800
- @@ -192,6 +192,9 @@
- char *spell_language = NULL;
- #endif
- +/* Value of "current_dir" key in ini file */
- +char *saved_current_dir = NULL;
- +
- /* Value of "other_dir" key in ini file */
- char *saved_other_dir = NULL;
- @@ -1005,8 +1008,12 @@
- {
- char *dirs;
- + dirs = get_panel_dir_for (current_panel);
- + mc_config_set_string (mc_global.panels_config, "Dirs", "current_dir", dirs);
- +
- dirs = get_panel_dir_for (other_panel);
- mc_config_set_string (mc_global.panels_config, "Dirs", "other_dir", dirs);
- +
- g_free (dirs);
- }
- --- ../mc-4.8.19.orig/src/main.c 2017-03-05 01:51:39.000000000 +0800
- +++ src/main.c 2018-02-05 18:11:14.352771282 +0800
- @@ -291,6 +291,7 @@
- {
- vfs_shut ();
- done_setup ();
- + g_free (saved_current_dir);
- g_free (saved_other_dir);
- mc_event_deinit (NULL);
- goto startup_exit_falure;
- @@ -305,6 +306,13 @@
- char *buffer;
- vfs_path_t *vpath;
- + buffer = mc_config_get_string (mc_global.panels_config, "Dirs", "current_dir", ".");
- + vpath = vfs_path_from_str (buffer);
- + if (vfs_file_is_local (vpath))
- + saved_current_dir = buffer;
- + else
- + g_free (buffer);
- +
- buffer = mc_config_get_string (mc_global.panels_config, "Dirs", "other_dir", ".");
- vpath = vfs_path_from_str (buffer);
- if (vfs_file_is_local (vpath))
- @@ -485,6 +493,7 @@
- g_list_free_full ((GList *) mc_run_param0, (GDestroyNotify) mcedit_arg_free);
- g_free (mc_run_param1);
- + g_free (saved_current_dir);
- g_free (saved_other_dir);
- mc_config_deinit_config_paths ();
- --- ../mc-4.8.19.orig/src/filemanager/midnight.c 2017-03-05 01:51:38.000000000 +0800
- +++ src/filemanager/midnight.c 2018-02-05 18:11:14.352771282 +0800
- @@ -601,7 +601,8 @@
- if (mc_run_param0 == NULL && mc_run_param1 == NULL)
- {
- /* no arguments */
- - current_dir = NULL; /* assume current dir */
- + //current_dir = NULL; /* assume current dir */
- + current_dir = saved_current_dir; /* from ini */
- other_dir = saved_other_dir; /* from ini */
- }
- else if (mc_run_param0 != NULL && mc_run_param1 != NULL)
- @@ -628,7 +629,8 @@
- if (mc_run_param0 == NULL && mc_run_param1 == NULL)
- {
- /* no arguments */
- - current_dir = NULL; /* assume current dir */
- + //current_dir = NULL; /* assume current dir */
- + current_dir = saved_current_dir; /* from ini */
- other_dir = saved_other_dir; /* from ini */
- }
- else if (mc_run_param0 != NULL && mc_run_param1 != NULL)
Add Comment
Please, Sign In to add comment