Split assignments and conditions. Type accuracy. Minor optimization.
Thanks Vit Rosin for original patch.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Changes into lib directory
* samba: handling result of system() call
* rpc: handling write errors
* ftpfs: ignoring result of fwrite() on logfile (make compiler happy ;-))
* fish: proper handling of file io calls
* ignoring result of fwrite() on logfile (make compiler happy ;-))
* lib/util.c: handling fwrite() call errors in mc_util_write_backup_content()
* lib/utilunix.c:
* handling possible error on dup() in close_error_pipe()
* handling possible error on getcwd() in mc_realpath()
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
On some systems i18n_checktimelength may vary not only depending on the
locale but also on the current month. This patch introduces a cyclic
check that loops through all of the months to find out which one has the
longest name.
However, since this function is called on every pannel reload and now
makes 24 calls to str_term_width1 and strftime it makes sense to
introduce a cache for the resulting value.
Thanks to Sergey Fionov <fionov@gmail.com> for the initial patch.
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
added src/diffviewer/ydiff.[ch] into project tree
added entry 'View diff files' into 'Command' menu
added 'diffviewer' color pairs
fixed Makefile and configure.am
added new binding CmdDiffView into '[main]' section
Big thanx to 'Daniel Borca <dborca@yahoo.com>' for ydiff
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Added diffviewer own library
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Fixed CFLAGS for diffviewer.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
changed skins, added section
[diffviewer]
added=
changedline=
changednew=
changed=
removed=
folder=
error=
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Reimplementation of hardcoded shortcuts to keybindings.
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
My system wide .rarrc contains these switches
switches= -m5 -mdG -r -s -t -ol -tl
So whenever you list the contents of any archive or copy a file out of
it, RAR/UNRAR will traverse *all* sub directories (note -r, recursive
switch) in a current directory trying to find *all* archives with the
same name. So, the net result might be that unrar/rar will extract
the wrong file and spend a lot of time trying to find archives with
the same name.
That's why I strongly suggest disabling user/system configuration
for archive list and copyout operations (note the added -cfg switch).
I have contacted Eugene Roshal and he said that he won't disable -r switch
for extract and archive list operations, so, we can only fix this problem
on our side.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Fixed tty_print_alt_char() to draw single or double vertical
or horizintal lines.
Added argument to tty_print_one_hline() and tty_print_one_vline()
functions to draw single or double lines.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Fixed bug introduced in ad9c1daad8 commit:
incorrect handling of "." and ".." directories within atchives.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Applied MC indentation policy to all files modified in this branch
with some simple manual modifications.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
If EXTFS plugin doesn't require a file, that file name must
be finished with '+': for example, rpms+. But trailing '+'
actually is not a part of plugin name, it is an plugin attrubute.
But in the current time trailing '+' must be used in VFS command:
cd #rpms+
instead of
cd #rpms
This commit simplifies the usage of some EXTFS plugins.
Also fixed VFS README.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Thanks Vit Rosin to found memory leak in _vfs_memleak() function.
This function was rewritten to fix two memory leaks.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
* Minimizing dialog;
* Optimizations of Copy/move progress dialog creation;
* Added enum for specify dialog type (for copy/move or for delete)
* Little optimization.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
* Optimized functions calls (changed return type of all file_progress_show*() functions)
* Reworked for use global structure FileOpTotalContext
* Moved declarations of file_progress_show*() functions from fileopctx.h to filegui.h
* Code for calculate progressbar's variables was moved into function copy_file_file_display_progress()
* Progressbar for little files now shows always 100% (for visible effect)
* Added i18n string '< 1 sec'
* Rework of progress copy dialog
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Suppose we have 3 files with version in their names:
* file-2.1.tgz
* file-2.2.tgz
* file-2.10.tgz
It is impossible to see them in natural order using standard facilities,
they will be sorted in alphabet order:
* file-2.1.tgz
* file-2.10.tgz
* file-2.2.tgz
There was some attempts to fix this. I've picked up the patch by Roland Illig <roland illig gmx de>
(http://mail.gnome.org/archives/mc-devel/2004-July/msg00016.html) and adopted it for today's git snapshot.
It adds "version" option to the sort menu, which uses copy of strverscmp function from glibc.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
extfs vfs plugins are read from following places:
1. ~/.mc/extfs.d directory.
2. /usr/libexec/mc/extfs.d direcotry.
Priority of plugins installed in user home directory
is highest. If there are two plugins with same names
exist in user home and system directories, the plugin
from user home is used.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Reimplemented EXTFS VFS to be friendly to package-based
systems. Currently, MC requires to edit extfs.ini file
to add new plugin to MC VFS. After upgrade, all changes
to this files will be lost.
To solve that problem, MC configuration system should
support ".d" pattern.
Initial step: refactoring of current extfs code:
cleanup, type accuracy, indentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Fixed showing of datetime format in various locales (such as Polish locale)
Added new options in config file:
[Misc]
...
timeformat_recent=%d.%m.%y %H:%M
timeformat_old=%d.%m.%y %H:%M
...
where
timeformat_recent - for files with mtime between now
and "6 moths old" (like "Nov 2 00:56")
timeformat_old - for other files (like "Jun 23 2007")
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Generally, Ctrl-\ is a default assignment to SIGQUIT signal.
S-Lang breaks this assignment. NCurses doesn't, therefore
MC just quits when user presses the Ctrl-\ key.
This commit emulates the S-Lang way in NCurses-based MC.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Comment by Oswald Buddenhagen:
first, you decided to ignore my advice about not
obfuscating the code with nonsense-checks, and on top of that you
broke the string comparison (just see what happens when you try a user
named "ftpmaster").
This commit contain changes for respect this critic.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Look at mcserv.c near 1019
The chroot() call's return value isn't handled - this may a security risk.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
The lslR VFS does not work with ls-lR files created in en_US.UTF-8 locale and with files and directories started with whitespaces.
Followed patch fixes both issues.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Fixed warings: local variable shadows a global declaration.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Reported-By: Dr. Stefan Thurner (TU-Chemnitz)
Since 4.7, on monochrome terminals (eg. xterm-mono) the
selections are not visible anymore (pre 4.7 inverted
the selected text).
Probably this has to do w/ the new skinning stuff.
Fix issue: added additional check for b&w terminal into skins engine.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
* moved src/fileloc.h into lib/fileloc.h
* moved src/timefmt.h into lib/timefmt.h
* removed unneedded includes into src/util.c
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
* moved src/global.h into lib/global.h
* moved glibcompat.[ch] from ./src/ into ./lib/
* moved fs.h from ./src/ into ./lib/
Signed-off-by: Slava Zanko <slavazanko@gmail.com>