Commit Graph

294 Commits

Author SHA1 Message Date
Andrew Borodin 2d9cf4cad1 (vfs_s_get_line_interruptible): disable interrrupt after finish of read
...and type accuracies.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-07-22 13:10:41 +04:00
Andrew Borodin e5203cb023 Fix name of FSF in all *.c files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-02-28 13:33:17 +04:00
Eugene San (eugenesan) 198334ccc4 From ticket #3116: fix possible segfault when freeing a VFS.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-02-10 16:27:03 +04:00
Andrew Borodin f0da49345a Collapse list of copyright years to ranges. Add 2014 year.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-02-10 16:27:03 +04:00
Andrew Borodin 094fd0cd89 Use symbolic names for standard file descriptors.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2014-02-10 16:26:17 +04:00
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
Andrew Borodin bb65b46790 Fix use of uninitialized memory in sigaction structure.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-11-25 13:47:40 +04:00
Slava Zanko 0ed4a91d7d Reduce cppcheck warnings (style) in lib subdirectory.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-11-25 13:47:39 +04:00
Slava Zanko 0d489acd58 cppcheck: reduce variable scope.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-11-25 13:47:39 +04:00
Slava Zanko a57d45d590 Ticket #3098: vfs_path_from_str_flags() doesn't support VPF_STRIP_HOME
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-11-08 16:57:42 +03:00
Andrew Borodin e78b1fdf66 Remove redundant checks for g_strdup().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:08 +04:00
Andrew Borodin 034e973fbf (vfs_translate_path): return const char *.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:08 +04:00
Andrew Borodin 546e89f611 (vfs_path_tokens_get): minor refactoring: replace while() by for().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:11:04 +04:00
Andrew Borodin 26fbddf6f4 (vfs_path_tokens_count): refactoring: get rid of extra memory allocation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:11:04 +04:00
Slava Zanko 857fe38e87 Fix panel recoding
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-07-23 14:15:24 +04:00
Andrew Borodin ab3f53fbbe Add DIR_IS_DOT and DIR_IS_DOTDOT macros
...to detect "." and ".." directories, respectively.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-07-23 14:15:24 +04:00
Amadeusz Sławiński 33c47b5734 Ticket #3025: race condition when creating temporary directory.
When there's no mc-tmpdir and a user tries to start two mc sessions
simultaneously, sometimes (in one out of ten attempts on my machine) one
mc session emits the following error message:

Cannot create temporary directory /tmp/mc-lars: File exists (17)
Temporary files will be created in /tmp
Press any key to continue...

Steps to reproduce:

# rm /tmp/mc-$(whoami) -rf
# uxterm -e mc & uxterm -e mc

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-07-05 20:58:41 +04:00
Slava Zanko d2eac2f5af Code reorganization and fixes around the vfs_path_as_str() function
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-06-28 09:21:16 +04:00
Andrew Borodin 32bc72a1d7 (vfs_path_as_string): clarify return value.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-28 09:21:16 +04:00
Andrew Borodin e7dc599e42 Use "'" instead of "`" for messages and comments quoting.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-03 14:21:03 +03:00
Andrew Borodin 3662b84ba1 (vfs_get_encoding): optimization and enhancement:
* get rid of extra memory duplication;
  * support of recursive search of correct encoding;
  * add tests.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-06-03 14:21:02 +03:00
Slava Zanko 2640b21bb9 Remove vfs_path_to_str() function for avoid often memory allocations.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-06-03 14:21:01 +03:00
Slava Zanko c984447f8e Rename vfs_path_cmp() to vfs_path_equals()
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-03-09 16:04:18 +04:00
Slava Zanko f866709186 Concretize the usage of autocompliting in different input fields.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-02-04 15:48:21 +03:00
Slava Zanko 2d58735deb Extend QUICK_INPUT and QUICK_LABELED_INPUT macros for getting completion flags via parameters instead of using hardcoded value
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-02-04 15:29:15 +03:00
Slava Zanko ee8aaf6181 Avoid compiler errors like: error: variable 'xxx' set but not used [-Werror=unused-but-set-variable]
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-01-17 15:21:35 +03:00
Andrew Borodin 5e070286b1 Indentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-12-20 16:22:23 +04:00
Andrew Borodin 17cadc50ec Portability: use g_ascii_strtoll instead of strtoll, atoll and atof.
Set minimal version of GLib up to 2.12 because of g_ascii_strtoll.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-12-20 15:35:35 +04:00
Andrew Borodin 82b1d7bff3 Parenthesis around some -1.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-12-20 15:35:35 +04:00
Pavel Vasilyev f84bbd8583 vfs_s_subclass::linear_read: return ssize_t instead of int.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-12-20 15:35:18 +04:00
Pavel Vasilyev fafd75c807 lib/vfs/direntry.c: types accuracy.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-12-20 15:35:18 +04:00
Andrew Borodin 848318f95f lib/vfs/vfs.h: indentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-12-20 15:35:18 +04:00
Andrew Borodin 60727b9b79 Clarify usage of AM_CPPFLAGS.
Use AM_CPPFLAGS not AM_CFLAGS for includes. GLIB_CFLAGS are CPPFLAGS, actually.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-12-18 16:27:49 +04:00
Andrew Borodin 2940b7455d Fix of DOXYGEN docs: @return instead of @returns
...and other minor corrections.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-11-09 10:05:13 +04:00
Andrew Borodin 1d3132c08f Clarify of sig_atomic_t usage (got from Mutt).
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-11-09 10:05:13 +04:00
Andrew Borodin 8b3ed9bfdc (mc_mkstemps): use g_mkstemp() to generate name of temporary file.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-10-20 15:39:44 +04:00
Ilia Maslakov 55c8f041da fixed doxygen documentation
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2012-09-10 14:29:53 +03:00
Andrew Borodin 4a0004f6c2 Ticket #2874: enter on directory named '~' goes to the home one.
Revert "Support of use ~ as home directory in hotlist."
This partially reverts commit dd9c7516a3.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-09-06 10:30:28 +04:00
Slava Zanko 949d257f37 Ticket #2791: Fixed: cannot Copy/Move files with filename encoding change
Steps to reproduce:
 * run mc
 * change encoding one of panels to any different from system encoding
 * try to copy any file to panel with changed encoding

Expected result: files should be copied.

Actual result: error box here.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-08-29 13:30:28 +03:00
Andrew Borodin 908e747861 Optimization of ini files load.
Some ini files (keymaps, skins) are loaded in read-only mode. For those
files, we don't need load and keep comments.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-07-31 14:50:11 +04:00
Andrew Borodin acdac76a49 Revert "Try fix of compile warnings about assigned but unused variables"
This reverts commit 6505f7d6fa.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-07-18 12:03:31 +04:00
Slava Zanko 94bd4b1f78 Code indentation.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-07-17 17:04:05 +04:00
Slava Zanko 6505f7d6fa Try fix of compile warnings about assigned but unused variables
...as returned values of functions declared with attribute
warn_unused_result [-Wunused-result].

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-07-17 17:04:05 +04:00
Andrew Borodin 23c95d36ac Code cleanup: removed unused variables amd removed unnedeed code.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-07-17 17:04:05 +04:00
Slava Zanko c277ac5b6f Ticket #2834: Fixed bug 'FTBFS with --disable-vfs'
Steps to reproduce:
 * ./configure --disable-vfs
 * make

Expected result: project should be builded successfully.

Actual result:
build stopped with errors:
lib/vfs/interface.c: In function 'mc_chdir':
lib/vfs/interface.c:714: error: 'struct vfs_s_super' has no member named 'path_element'
lib/vfs/interface.c:716: error: 'struct vfs_s_super' has no member named 'path_element'
lib/vfs/interface.c:717: error: 'struct vfs_s_super' has no member named 'path_element'

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-06-29 12:45:57 +03:00
Andrew Borodin 315c499c09 Ticket #2827: tweak and cleanup of code in case of --disable-charset option usage.
First step: tweak vfs-related code.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-06-25 16:56:11 +04:00
Slava Zanko a2a01d94e9 Ticket #2821: Fixed defect: ftp to a second site does not work
Steps to reproduce:

 * cd  ftp://ftp.gnome.org/
 * Run "cd" in the panel where the remote site is open
 * cd  ftp://ftp.kernel.org/

Actual result: The directory content from ftp.gnome.org FTP-server.
Expected results: The directory content from kernel.org FTP-server.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-06-06 12:07:54 +03:00
Slava Zanko 5c6ae102f2 lib/vfs/interface.c: Added checking if super->path_element is not NULL
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-05-18 13:44:12 +03:00
Slava Zanko 21d1f61b40 Ticket #2800: Garbage directory listing in ftpfs
Just open any non-anonymous FTP connection.
2012-05-18 12:31:29 +03:00
Andrew Borodin a878a2dd37 (vfs_expare): changed argument type from int to gboolean.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-04-22 11:25:11 +03:00