mc/lib
Egmont Koblinger 7866bf7342 Ticket #3093: keep symlinks in cwd at startup.
If you navigate in your shell to a directory containing symlinks and
then start mc, mc will show the canonical path instead. It would be nice
to make it show the directory with the symlinks.

Example: in your shell execute these:

user:~$ mkdir -p /tmp/a/b /tmp/x ; ln -s /tmp/a/b /tmp/x/y
user:~$ cd /tmp/x/y
user:/tmp/x/y$ mc

In mc you'll find yourself in /tmp/a/b, though it'd be nicer to see
/tmp/x/y at the top, and correspondingly navigating to the parent would
take you to /tmp/x.

If you start bash or zsh from /tmp/x/y, the new instance will start
displaying the working directory as such. They do this via the PWD env
variable. On one hand, they set and maintain PWD to point to the current
directory, using the path as specified by the user (possibly containing
symbolic links). On the other hand, they check its value at startup. If
$PWD points to the same physical directory as the actual working
directory then they use this value. If $PWD points somewhere else then
it's simply ignored (so it's a hint only as to which symlinks to use to
get to the working directory, but never alters the actual cwd).

Now mc also does the same at startup (with respect of "Cd follows
links" option). Relative directories specified in the command line  are
applied after possibly replacing the canonical cwd with $PWD. This way
for example

user:/tmp/x/y$ mc . ..

opens two panels in /tmp/x/y and /tmp/x instead of /tmp/a/b and /tmp/a
(whereas /tmp/x is actually a different directory than /tmp/a).

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-12-27 19:07:58 +04:00
..
event PCRE_CFLAGS are CPPFLAGS, actually. 2012-12-18 16:27:49 +04:00
filehighlight cppcheck: reduce variable scope. 2013-11-25 13:47:39 +04:00
mcconfig (mc_config_new_or_override_file): minor optimization. 2013-03-09 16:04:51 +04:00
search Fix search in internal viewer in case of nroff mode. 2013-11-25 13:47:40 +04:00
skin (mc_skin_colors_old_configure_one): cosmetics. 2013-10-04 09:11:04 +04:00
strutil cppcheck: reduce variable scope. 2013-11-25 13:47:39 +04:00
tty Ticket #3114: fix broken build with NCurses. 2013-12-04 15:14:07 +04:00
vfs Ticket #3093: keep symlinks in cwd at startup. 2013-12-27 19:07:58 +04:00
widget Use g_list_free_full(). 2013-11-25 13:47:40 +04:00
charsets.c cppcheck: reduce variable scope. 2013-11-25 13:47:39 +04:00
charsets.h Core, mceditor, mcviewer and mcdiffviewer code tweak and cleanup 2012-06-25 16:58:57 +04:00
event-types.h Optimization of history load. 2011-06-21 16:13:10 +04:00
event.h Event system: added addition parameter event_init_data to mc_event_del() function. 2011-06-21 16:13:10 +04:00
filehighlight.h Rename type file_entry to the file_entry_t. 2013-09-19 16:22:30 +04:00
fileloc.h Ticket #2625: mc does not preserve file mtime when copying over ssh 2011-12-12 11:51:25 +03:00
fs.h Add DIR_IS_DOT and DIR_IS_DOTDOT macros 2013-07-23 14:15:24 +04:00
glibcompat.c Use g_list_free_full(). 2013-11-25 13:47:40 +04:00
glibcompat.h Use g_list_free_full(). 2013-11-25 13:47:40 +04:00
global.c (mc_global_t::shell): new member to store user's shell 2013-01-16 14:34:11 +04:00
global.h Refactoring: use define DEFAULT_CHARSET for "ASCII" charset. 2013-09-21 13:35:59 +04:00
hook.c Remove irrelevant comments about file_date() function. 2013-01-16 14:34:34 +04:00
hook.h fixed doxygen documentation 2012-09-10 14:29:53 +03:00
keybind.c cppcheck: reduce variable scope. 2013-11-25 13:47:39 +04:00
keybind.h Ticket #2863 (mcdiff bidirectional merge enhancement) 2012-08-30 10:43:20 +04:00
lock.c Fix of DOXYGEN docs: @return instead of @returns 2012-11-09 10:05:13 +04:00
lock.h Changed lock_file() and unlock_file() functions 2012-03-06 11:52:30 +03:00
logging.c cppcheck: reduce variable scope. 2013-11-25 13:47:39 +04:00
logging.h Added new function mc_always_log() for logging on early bootstrap stages 2011-01-20 17:38:27 +02:00
Makefile.am PCRE_CFLAGS are CPPFLAGS, actually. 2012-12-18 16:27:49 +04:00
mcconfig.h Add support of reading parameters for external editor/viewer from main config. 2013-02-16 17:40:37 +03:00
search.h Search: better support of --disable-charset 2013-09-21 13:35:56 +04:00
serialize.c fixed doxygen documentation 2012-09-10 14:29:53 +03:00
serialize.h Added ability to serialize/deserialize strings and config objects(mc_config_t) 2011-06-23 14:45:00 +03:00
skin.h Skin support for window frames. 2012-06-20 22:26:10 +04:00
strescape.h Code indentation in lib directory 2010-11-24 10:27:20 +03:00
strutil.h Typo fixes. 2013-07-23 14:15:24 +04:00
timefmt.c Ticket 1551: Update GPL version from 2 to 3 2011-10-18 14:08:34 +03:00
timefmt.h Moved time related stuff from lib/util.[ch] into lib/timefmt.[ch]. 2010-11-24 10:27:47 +03:00
unixcompat.h Use AC_HEADER_MAJOR. 2013-11-25 13:47:40 +04:00
util.c Reduce cppcheck warnings (style) in lib subdirectory. 2013-11-25 13:47:39 +04:00
util.h Rename type file_entry to the file_entry_t. 2013-09-19 16:22:30 +04:00
utilunix.c Fix use of uninitialized memory in sigaction structure. 2013-11-25 13:47:40 +04:00
utilunix.h Lib: removed includes to "src" directory 2011-03-21 23:55:52 +02:00
widget.h Rename Dlg_head to WDialog. 2012-11-19 21:42:47 +04:00