diff -urp mc-4.8.10.orig/lib/vfs/vfs.c mc-4.8.10/lib/vfs/vfs.c
old
|
new
|
|
44 | 44 | #include <config.h> |
45 | 45 | |
46 | 46 | #include <errno.h> |
| 47 | #include <stdlib.h> |
47 | 48 | |
48 | 49 | #include "lib/global.h" |
49 | 50 | #include "lib/strutil.h" |
… |
… |
vfs_setup_cwd (void) |
538 | 539 | if (vfs_get_raw_current_dir () == NULL) |
539 | 540 | { |
540 | 541 | char *tmp; |
| 542 | vfs_path_t *tmp_vpath; |
541 | 543 | |
542 | 544 | tmp = g_get_current_dir (); |
543 | 545 | vfs_set_raw_current_dir (vfs_path_from_str (tmp)); |
544 | 546 | g_free (tmp); |
| 547 | |
| 548 | tmp = getenv ("PWD"); |
| 549 | tmp_vpath = vfs_path_from_str (tmp); |
| 550 | if (tmp_vpath != NULL) |
| 551 | { |
| 552 | struct stat my_stat, my_stat2; |
| 553 | if (mc_global.vfs.cd_symlinks |
| 554 | && mc_stat (tmp_vpath, &my_stat) == 0 |
| 555 | && mc_stat (vfs_get_raw_current_dir (), &my_stat2) == 0 |
| 556 | && my_stat.st_ino == my_stat2.st_ino && my_stat.st_dev == my_stat2.st_dev) |
| 557 | vfs_set_raw_current_dir (tmp_vpath); |
| 558 | else |
| 559 | vfs_path_free (tmp_vpath); |
| 560 | } |
545 | 561 | } |
546 | 562 | |
547 | 563 | path_element = vfs_path_get_by_index (vfs_get_raw_current_dir (), -1); |
diff -urp mc-4.8.10.orig/src/main.c mc-4.8.10/src/main.c
old
|
new
|
main (int argc, char *argv[]) |
293 | 293 | |
294 | 294 | vfs_init (); |
295 | 295 | vfs_plugins_init (); |
296 | | vfs_setup_work_dir (); |
297 | 296 | |
298 | 297 | /* Set up temporary directory after VFS initialization */ |
299 | 298 | mc_tmpdir (); |
… |
… |
main (int argc, char *argv[]) |
341 | 340 | |
342 | 341 | load_setup (); |
343 | 342 | |
| 343 | /* Must be done after load_setup because depends on mc_global.vfs.cd_symlinks */ |
| 344 | vfs_setup_work_dir (); |
| 345 | |
| 346 | /* Resolve the other_dir panel option. Must be done after vfs_setup_work_dir */ |
| 347 | { |
| 348 | char *buffer; |
| 349 | vfs_path_t *vpath; |
| 350 | |
| 351 | buffer = mc_config_get_string (mc_panels_config, "Dirs", "other_dir", "."); |
| 352 | vpath = vfs_path_from_str (buffer); |
| 353 | if (vfs_file_is_local (vpath)) |
| 354 | saved_other_dir = buffer; |
| 355 | else |
| 356 | g_free (buffer); |
| 357 | vfs_path_free (vpath); |
| 358 | } |
| 359 | |
344 | 360 | /* start check mc_global.display_codepage and mc_global.source_codepage */ |
345 | 361 | check_codeset (); |
346 | 362 | |
diff -urp mc-4.8.10.orig/src/setup.c mc-4.8.10/src/setup.c
old
|
new
|
|
43 | 43 | #include "lib/util.h" |
44 | 44 | #include "lib/widget.h" |
45 | 45 | |
46 | | #include "lib/vfs/vfs.h" |
47 | | |
48 | 46 | #ifdef ENABLE_VFS_FTP |
49 | 47 | #include "src/vfs/ftpfs/ftpfs.h" |
50 | 48 | #endif |
… |
… |
load_setup (void) |
989 | 987 | if (startup_left_mode != view_listing && startup_right_mode != view_listing) |
990 | 988 | startup_left_mode = view_listing; |
991 | 989 | |
992 | | { |
993 | | vfs_path_t *vpath; |
994 | | |
995 | | buffer = mc_config_get_string (mc_panels_config, "Dirs", "other_dir", "."); |
996 | | vpath = vfs_path_from_str (buffer); |
997 | | if (vfs_file_is_local (vpath)) |
998 | | saved_other_dir = buffer; |
999 | | else |
1000 | | g_free (buffer); |
1001 | | vfs_path_free (vpath); |
1002 | | } |
1003 | | |
1004 | 990 | boot_current_is_left = mc_config_get_bool (mc_panels_config, "Dirs", "current_is_left", TRUE); |
1005 | 991 | |
1006 | 992 | /* Load time formats */ |