Commit Graph

1080 Commits

Author SHA1 Message Date
Slava Zanko
bfbe9b94ae Removed global variable slow_tty
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-09-08 14:12:10 +04:00
Slava Zanko
9d9935d290 Removed global variable ugly_line_drawing
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-09-08 14:12:10 +04:00
Slava Zanko
8d44ed297b Moved xterm_flag global variable to mc_global.tty.xterm_flag
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-09-08 14:12:10 +04:00
Andrew Borodin
387bad2c7e Move SIGWINCH handler initialization to tty_init()
... and rename tty_low_level_change_screen_size() to
tty_change_screen_size().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-09-08 14:11:51 +04:00
Andrew Borodin
ad0a5015d3 Fix of mouse and ca capabilities check.
Based on patch from Andrey V. Malyshev <amal krasn ru>
http://mail.gnome.org/archives/mc-devel/2005-November/msg00052.html

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-09-08 14:10:58 +04:00
Andrew Borodin
09123c9fc9 Refactoring of TTY layer shutdown.
Unification of tty_shutdown() function as for S-Lang as for NCurses.
Added do_exit_ca_mode() call to the NCurses-based tty_shutdown().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-09-08 14:10:58 +04:00
Andrew Borodin
68468a25ac Ticket #2601: incorrect TTY layer initialization.
The xterm_flag variable was initialized in setup_mc() but used
first time in init_key() and in tty_init() (in do_enter_ca_mode())
before setup_mc() call.

Now xterm initialized in early step of mc start up process and
xterm support and mouse are initialized in tty_init().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-09-08 14:10:51 +04:00
Andrew Borodin
fc3bb20f09 (size_trunc): added ability to show size in [G|g]bytes.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-08-30 21:36:13 +04:00
Andrew Borodin
12c893c73e (size_trunc_len): process full range of uintmax_t type.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-08-30 21:36:13 +04:00
Andrew Borodin
3ec8721f47 (mc_search__hex_translate_to_regex): optimization and cleanup.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-07-19 12:45:10 +04:00
Andrew Borodin
efb4206883 Ticket #2579: incorrect length usage in hexadecimal search.
(mc_search__hex_translate_to_regex): don't use length of original string
after leading whitespace trim.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-07-19 12:34:11 +04:00
Slava Zanko
1940e8f5dd Fixed broken search results highlighting
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-07-19 09:51:08 +03:00
Andrew Borodin
c4b95bcd32 Ticket #2576: fix of symbols duplication.
dialog_map, input_map and listbox_map variabels are declared and defined twice.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-07-14 21:46:59 +04:00
Slava Zanko
d3bb9de01f Ticket 2570: Code cleanup
Moved tests from lib/tests to tests/lib directory

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-07-11 20:23:44 +03:00
Slava Zanko
4e56efafe6 Ticket #81: savannah: can't access files on ftp starting with space
files starting with space can't be acessed by mc through ftp - it
shows the file as not having the leading space and attempts to
access it produce 'permission denied' errors.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-07-11 19:50:32 +03:00
Andrew Borodin
17033652ee Revert "Ticket #2453: aggressive screen repaint"
This reverts commit f809e6cf7a.

While navigating in main menu (from one submenu to another one)
or after closing a dialog, the screen is blinking.
2011-07-09 20:39:46 +04:00
Slava Zanko
63c0f34dce Direct commit: Fixed double memory free in input histoey list.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-07-09 11:55:30 +03:00
Andrew Borodin
f3fefa67f6 (push_history): fixed memory leak.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-07-08 20:48:53 +04:00
Andrew Borodin
630bcae4d4 (input_destroy): optimization: don't do useless actions.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-07-08 20:48:53 +04:00
Andrew Borodin
de5fac8d0a Ticket #2545: fixup of saving WInput history.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-07-08 20:48:53 +04:00
Slava Zanko
e1edfd7c93 Remove replace_prepare_t type and use defined constants for use just one type (int) in functions
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-07-08 17:28:07 +03:00
Vitaliy Filippov
fb7b01eeb9 Despite of the fact that algorithm now ignores the absence of closing curly
brace '}' (which probably isn't 100% correct), this should be checked in tests
for replace_handle_esc_seq function, not process_escape_sequence - it is the
replace_handle_esq_seq who decides whether it is an escape sequence or not.

Also, \x{4344} is usually a code for wide character (UTF-8), and not for "CD".
So we can either ignore the higher bits, or generate wide character codes...
The second would be convenient, but would also introduce a hard-coded UTF-8 charset.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-07-08 17:28:07 +03:00
Slava Zanko
3ced63361b added tests for mc_search_regex__replace_handle_esc_seq() function
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-07-08 17:28:07 +03:00
Slava Zanko
6cec807140 str_isutf8() function now returns gboolean value
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-07-08 17:26:31 +03:00
Vitaliy Filippov
aa2d0b07ed Ticket #1882: PCRE search: escape sequence support in replacements, UTF8 support (just a flag for libPCRE)
Enables use of escape sequences inside regex replace strings,
Enables UTF-8 caseless search in PCRE.
Supported escape sequences: \DEC, \xHEX, \0OCT, \n, \t, \v,
\b, \r, \f, \a. Any of them could be enclosed into \{}.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-07-08 17:26:30 +03:00
Slava Zanko
bb12a1296f Direct commit: fixed broken build
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-07-08 13:49:56 +03:00
Andrew Borodin
f809e6cf7a Ticket #2453: aggressive screen repaint
... to avoid artefacts after printing of non-printable symbols.

(tty_touch_lines): new function to mark modified lines of screen.
(do_refresh): mark lines as modified before redraw of non-fullscreen dialog
and clear entire screen before redraw of fullscreen dialog.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-07-08 13:51:41 +04:00
Andrew Borodin
8ff0da42cd lib/mcconfig/paths.c: cleanup.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-07-08 12:38:03 +03:00
Slava Zanko
c057627979 Ticket #1851: Home config directory [xdg-user-dirs]
Fixed migrating user config files.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-07-08 12:38:03 +03:00
Andrew Borodin
5ffcffbeb6 Optimization of history saving.
Now history is not saved if it was not modified and content of input
line is equal to history top entry. Thanks Francesco Cosoleto
<cosoleto at gmail dot com> for the original patch.

Also fixed a regression introduced in cff5925598:
after CK_HistoryNext and CK_HistoryPrev actions in input line,
the input line content is not put to the top of history.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-07-07 14:19:15 +04:00
Andrew Borodin
1a343a1a47 Type accuracy and some clean up.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-07-07 14:19:15 +04:00
Andrew Borodin
166281c39a Ticket #2545: optimization of history saving.
(hist_next): get rid of direct access to the next histroy item.
(history_show): remove redundant check.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-07-07 14:19:15 +04:00
Slava Zanko
0f249bd9b5 Fixed errors while connect to IPv6 hosts
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-07-05 16:09:57 +03:00
Slava Zanko
2044d8f853 custom_canonicalize_pathname(): Removed old-style path handling.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-07-05 16:09:57 +03:00
Slava Zanko
32a9f8257d Deprecated parser now used just in Hotlist widget.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-07-05 16:09:57 +03:00
Slava Zanko
12af8e5db0 fixed relative symlink operations. Symlink now stay relative
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-07-05 16:09:57 +03:00
Andrew Borodin
ea4078e52e Ticket #2361: VFS URI reimplementation
Code cleanup:

 * (vfs_set_raw_current_dir): remove redundant check.
 * VFS: minor optimizations.
 * Fixed type of mode argument of vfs_class:chmod method.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-07-05 16:09:23 +03:00
Slava Zanko
c8ae0a5aaf Code cleanup
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:45:02 +03:00
Slava Zanko
91fe0d71bb vfs_path_get_by_index(): added check for valid element index
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:45:02 +03:00
Slava Zanko
5fa1070225 Fixed memory leaks in folowing functions:
* mc_opendir()
 * mc_chdir()
 * vfs_release_path()
 * check_panel_timestamp()

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:45:02 +03:00
Slava Zanko
60123b7c99 Removed function vfs_s_get_path(); Function vfs_s_get_path_mangle() renamed to vfs_s_get_path()
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:45:02 +03:00
Slava Zanko
1beaecdf12 Added function mc_build_filename() for processing URL-paths as well
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:45:02 +03:00
Slava Zanko
1eb91d7921 fixed x_basename function for handle URL-like paths
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:45:01 +03:00
Slava Zanko
04a4ed0ece added vfs_path_element_valid() function
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:45:01 +03:00
Slava Zanko
f7518c8d77 change name of user bindings file to mc.ext
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:45:01 +03:00
Slava Zanko
bba132381e vfs_path_to_str() now return URL string instead of old representation
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:45:01 +03:00
Slava Zanko
2ec4cc59ab Added URL-like path parser
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:45:01 +03:00
Slava Zanko
39462b9b76 Reorder VFS parser to work with VFS parameters:
* Removed vfs_path_element_t->raw_url_str;
 * Changed some VFS prefixes (colon now used when need to split VFS prefix and VFS parameters);
 * Removed vfs_translate_url() functions and related code;
 * added converter of VFS parameters to string representation.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:45:01 +03:00
Slava Zanko
bd022573e5 Handle path /some/path/#vfsprefix:/path as /some/path#vfsprefix:/path
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:45:00 +03:00
Slava Zanko
e6ec447585 Following prototypes of functions was changed in VFS-module API:
* archive_check
 * archive_same
 * open_archive

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:45:00 +03:00
Slava Zanko
e9ed6a41cf Added function vfs_path_url_split() for parse VFS parameters
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:45:00 +03:00
Slava Zanko
3d1e2df9b7 Removed vfs_get_class() function
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:45:00 +03:00
Slava Zanko
922114a1d0 Following prototypes of functions was changed in VFS-module API:
* archive_check
 * archive_same
 * open_archive

Added new functions:

 * vfs_path_element_clone()
 * vfs_path_clone()
 * vfs_path_remove_element_by_index()

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:45:00 +03:00
Slava Zanko
c442e5e75f Changed custom_canonicalize_pathname() function for handle URL:// style
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:45:00 +03:00
Slava Zanko
d931785fd3 Added test for canonicalize_pathname() function
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:45:00 +03:00
Slava Zanko
997876a109 Remove vfs_url_t structure (replace with vfs_path_element_t)
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:45:00 +03:00
Slava Zanko
3eafe7308a Added serialization and deserialization for vfs_path_t object
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:45:00 +03:00
Slava Zanko
e7bb47cc2d Added ability to serialize/deserialize strings and config objects(mc_config_t)
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:45:00 +03:00
Slava Zanko
be0f9dda56 mcconfig: make parameters in some functions as const mc_config_t *
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:45:00 +03:00
Slava Zanko
f8c45706e1 Avoid memory leaks in vfs tests
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:45:00 +03:00
Slava Zanko
e8d58f188d Fixed segfault while trying create dir in r/o VFS'es
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:45:00 +03:00
Slava Zanko
cec54195e7 Changes in VFS-tests.
* added test for checking encoding in VFS-module
 * fixed names of log-files for tests

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:59 +03:00
Slava Zanko
ac939a1bea Fixed path recoding in VFS modules
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:59 +03:00
Slava Zanko
691c06ce30 removed vfs_path_t->unparsed variable
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:59 +03:00
Slava Zanko
a5dc2de78b Added vfs_change_encoding() and vfs_path_element_need_cleanup_converter() functions.
Changes for handling directory encoding.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:59 +03:00
Slava Zanko
c0004807d4 vfs_path_element_t->encoding now handled in lib/vfs/path.c
Added testcase for testinh path encoding.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:59 +03:00
Slava Zanko
cedad03833 Move vfs_get_encoding() to path.c and make as static function.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:59 +03:00
Slava Zanko
b0df841a4a Removed vfs_path_t->unparsed_encoding.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:59 +03:00
Slava Zanko
ebe519ef15 remove struct dirinfo definition
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:59 +03:00
Slava Zanko
405cc98cea VFS: Make functions vfs_canon_and_translate() and vfs_canon() as static in lib/vfs/path.c
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:59 +03:00
Slava Zanko
8ea49095c3 Changed functions vfs_file_is_local() and vfs_file_class_flags() for handle vfs_path_t type
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:59 +03:00
Slava Zanko
7745006b60 VFS: removed interface.h
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:59 +03:00
Slava Zanko
093128c532 VFS: Current directory handler now have type vfs_path_t
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:59 +03:00
Slava Zanko
c188153507 Add more tests for VFS
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:59 +03:00
Slava Zanko
a12fdfbb0e VFS: many changes for use vfs_path_t
* completed vfs_path_from_str();
 * completed vfs_path_to_str() and vfs_path_to_str_elements_count();
 * removed deprecated vfs_split();
 * changes in all related code;
 * new unit tests.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:59 +03:00
Slava Zanko
9e4dc03e9e lib/vfs/direntry.c: vfs_s_inode_from_path() and vfs_s_get_path() now handle vfs_path_t
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:59 +03:00
Slava Zanko
9a28ce8c8d Add more tests for VFS
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:58 +03:00
Slava Zanko
6329976c89 VFS: fixed # sign in passwd or in path string
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:58 +03:00
Slava Zanko
91f3d8f4fd Added strrstr_skip_count() function.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:58 +03:00
Slava Zanko
fc8a86766b Add more tests for VFS
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:58 +03:00
Slava Zanko
152124d9b7 Following prototypes of functions was changed in VFS-module API:
* getid
 * mkdir
 * rmdir
 * setctl

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:58 +03:00
Slava Zanko
d67da5dfa8 Following prototypes of functions was changed in VFS-module API:
* readlink
 * symlink
 * rename
 * link
 * unlink
 * mknod

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:58 +03:00
Slava Zanko
1406eb5035 Following prototypes of functions was changed in VFS-module API:
* opendir
 * stat
 * lstat
 * chdir

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:58 +03:00
Slava Zanko
bf54195f07 added tests for get_vfs_class() function
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:58 +03:00
Slava Zanko
dd19ca201d Following prototypes of functions was changed in VFS-module API:
* chmod
 * chown
 * utime

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:58 +03:00
Slava Zanko
479902f83e Following prototypes of functions was changed in VFS-module API:
* open
 * getlocalcopy
 * ungetlocalcopy

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:58 +03:00
Slava Zanko
41f2e27f8d VFS: Use vfs_path_t in some interface functions
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:58 +03:00
Slava Zanko
3a1936aade Added vfs_path_t structure
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:57 +03:00
Slava Zanko
2c0ae5aa55 Moved interface functions from lib/vfs/vfs.[ch] to lib/vfs/interface.[ch]
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:57 +03:00
Andrew Borodin
42bc3171c3 Ticket #2361: VFS URI reimplementation
Created vfs_url_t structure

...and use it to parse and store network VFS options.

vfs_s_super structure now has a special member for network VFS options.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-23 14:44:57 +03:00
Andrew Borodin
ccd42c0fab (mc_config_new_or_override_file): create file w/o O_SYNC flag.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-06-21 16:13:10 +04:00
Andrew Borodin
82b27ead4d Optimization of history load.
Formerly, each widget loaded its history self in its constructor.
Thus, history file was read as many times as many widgets with history
are in dialog.

Now all widget histories are read from ${XDG_CACHE_HOME}/mc/history
file at one time after dialog initialization.

The ev_history_load_save_t event is apllied to load  histories.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-06-21 16:13:10 +04:00
Andrew Borodin
cff5925598 Optimization of history save.
Formerly, each widget saved its history self in WIDGET_DESTROY stage.
Thus, history file was read and written as many times as many widgets
with history are in dialog.

Now all widget histories are written to ${XDG_CACHE_HOME}/mc/history
file at one time before dialog destruction.

An ev_history_load_save_t event type is created to use new event engine
to save histories.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-06-21 16:13:10 +04:00
Slava Zanko
b473577525 Event system: added addition parameter event_init_data to mc_event_del() function.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-06-21 16:13:10 +04:00
Andrew Borodin
3aa74a2320 Added event_group member to the Dlg_head structure
...to start use the new event engine in widgets.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-06-21 16:13:10 +04:00
Andrew Borodin
7d469f841c (history_save): new function to save widget history
...to some in-memory created config without write it to file.

(history_put): now uses history_save().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-06-21 16:13:10 +04:00
Slava Zanko
b375236b53 Ticket #2544: search dialog trim spaces
What steps will reproduce the problem?

 * View some text (log) file (F3), or edit (F4).
 * Open search dialog (F7).
 * Enter string starting with space and ending with space (I used " ERROR " without quotes), press Enter
 * Press F7 to open search dialog again.

What is the expected output?
 * Original string in search dialog (" ERROR " without quotes)

What do you see instead?
 * "ERROR " (without leading space!)

What solution?
 * In function mc_config_set_string_raw() use g_key_file_set_string() instead of g_key_file_set_value()
 * change src/learn.c for handle new behavior
 * write some tests for new behavior

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-05-31 18:50:31 +03:00
Andrew Borodin
05ae0b187d Ticket #2459: if active panel changed type from file listing to info, inactive panel is not become active.
How to reproduce:

1. Run mc.
2. Change both panels to listing modes.
3. Switch to the right panel.
4. Switch type of active right panel to info using menu.

Result: left panel is not active.
Expected result: left panel must become active.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-05-04 17:07:25 +04:00
Andrew Borodin
47115e97ad Fix of terminal resize handling
...and fix of <sys/ioctl.h> includes
and includes cleanup in src/filemanager/layout.c.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-04-13 13:37:46 +04:00
Andrew Borodin
291abae262 (str_choose_str_functions): small fix.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-04-13 13:37:46 +04:00
Andrew Borodin
d92a2a4fd6 Get rid of some function forward declarations.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-04-13 13:37:46 +04:00
Andrew Borodin
330e3c60bc Dlg_head::parent is unused. Removed.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-04-13 13:37:46 +04:00
Ilia Maslakov
5acb75c6cd Check whether VFS provides an open_archive() method.
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2011-04-12 12:53:49 +04:00
Andrew Borodin
1796c8536a Ticket #2535: segfault in FTP VFS
...because of uninitialized pointer usage. The bug was introduced
in 68628184b1 commit.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-04-12 12:31:55 +04:00
Slava Zanko
b46d2a3d62 Renamed struct vfs_s_fh to vfs_file_handler_t
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-04-07 13:45:46 +04:00
Andrew Borodin
68628184b1 vfs_s_super and vfs_s_fh now don't contain members specific to any vfs.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-04-07 13:45:46 +04:00
Andrew Borodin
519246eccd Use GList to store directory content in vfs_s_inode.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-04-07 13:45:46 +04:00
Andrew Borodin
401aaa5014 Ticket #2501: continue split of VFS core library and VFS plugins.
Use GList for list of vfs_s_super objects in vfs_s_subclass.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-04-07 13:45:46 +04:00
Andrew Borodin
32bffa8890 Ticket #2516: Fix build failure on DragonFly BSD
DragonFly BSD doesn't provide MAXNAMLEN macro to define size of d_name
member of dirent structure. NAME_MAX is used if MAXNAMLEN is not
provided by OS.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-04-07 13:32:40 +04:00
Andrew Borodin
f83bdadfa8 Ticket #2520: SIGINT generated by Ctrl-g pressing closes file panels.
When SIGINT signal is raised, the CK_Cancel message is handled by
dlg_execute_cmd() and midnight_dlg is closed.

The solution: CK_Cancel is sent to current dialog via callback, and if
current dialog doesn't handle CK_Cancel message, then handle it with common
way using dlg_execute_cmd().

Since Ctrl-g is used to generate SIGINT in MC, remove this shortcut from
all sections of keymaps except the [dialog] section.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-30 16:17:16 +04:00
Pavel Vasilyev
f4cbe4a4f3 Ticket #2515: Unused variable if without WITH_BACKGROUND
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-25 14:19:40 +01:00
Slava Zanko
994254917c Added test for checking if library is independ to $(topsrcdir)/src
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:53 +02:00
Slava Zanko
06f99484de Added configure parameter --enable-mclib for build own shared library
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:53 +02:00
Slava Zanko
7df04e95e2 Added manual for events (Russian and English).
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:53 +02:00
Slava Zanko
f40887c3c6 Lib: removed includes to "src" directory
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:52 +02:00
Slava Zanko
6621250292 Added events for handle parent_call_string() and parent_call()
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:52 +02:00
Slava Zanko
a01b8edd7a Use events for suspend mc (by pressing on CTRL+Z)
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:52 +02:00
Slava Zanko
aad40e52fb Moved mc_refresh() to lib/widget
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:52 +02:00
Slava Zanko
5f8a5e4290 Use events for calling help window
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:52 +02:00
Slava Zanko
62207c8d4d Use events for operate with clipboard (copy/paste to external clipboard, save/load to file)
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:52 +02:00
Slava Zanko
c2dfb82f61 Use events for update panels
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:52 +02:00
Slava Zanko
3634716374 Moved input_map, listbox_map and dialog_map variables to 'lib' subdirectory.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:51 +02:00
Slava Zanko
c58365fa64 Move check_for_default() function from lib/util.c to src/util.c
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:51 +02:00
Slava Zanko
7dad2df6a8 Moved initialization of mc_global.share_data_dir and mc_global.sysconf_dir to library
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:51 +02:00
Slava Zanko
e784cf65a5 Move src/filemanager/complete.c to lib/widget/input_complete.c
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:51 +02:00
Slava Zanko
5a458c702d Use events to show VFS messages.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:51 +02:00
Slava Zanko
746653fda2 Removed mc_main_error_quark() function
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:51 +02:00
Slava Zanko
4005b7924e Use events to check timestamp of panel directories
...instead of direct access to panels in VGS GC.

Inlcudes clean up.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:51 +02:00
Slava Zanko
6016620f42 Remove backlinks from lib to src - move global variables(used in lib) to mc_global structure (see lib/global.c)
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 23:55:50 +02:00
Slava Zanko
6c5f5bf768 VFS structure changes:
* moved from lib/vfs/mc-vfs to lib/vfs;
  * split by directories for VFS-plugins and moved to src/vfs;
  * lib/vfs/vfs-impl.h was merged into lib/vfs/vfs.h.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 11:48:26 +02:00
Slava Zanko
d512649b33 Prepare to initialize application events.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 11:46:41 +02:00
Slava Zanko
a5195d285a Added new engine for universal event system.
Example:

gboolean mkdir_callback(const gchar *event_group, const gchar *event_name, gpointer init_data, gpointer event_data)
{
    ... /* some action for handle event */
    return TRUE; /* got chance to run other callbacks for this event or */
    return FALSE; /* break execution for other callbacks */
}

mc_event_add ("filesystem", "mkdir", mkdir_callback, "some init data", NULL);
mc_event_add ("filesystem", "mkdir", mkdir_log_callback, "some init data", NULL);
mc_event_add ("filesystem", "mkdir", third_callback, NULL, NULL);

/*
    Last add - first run. In this case execution order is
 * third_callback
 * mkdir_log_callback
 * mkdir_callback
 if third_callback fuctions will return FALSE, then other callbacks
 (mkdir_log_callback and mkdir_callback) never run!
*/

... /* some code */

/* for example, after pressing F7 */
mc_event_raise("filesystem", "mkdir", "some event_data... path to directory");

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-21 11:46:40 +02:00
Andrew Borodin
5ef6375120 Symbolic names of keymap sections are defined.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-20 19:26:08 +03:00
Andrew Borodin
b3d0a9237b Change hardcoded definitions of default keymap.
Now default key bindings are hardcoded as strings like values in keymap
file. Such presentation of key bindings allows simplify keymaps merge
when new bindings are added, replaced or removed old ones during MC
initialization.

Previously, to rebind some keys, used must redefine the entire section
where that bindings are in. New merge algorithm doesn't require the
redefinition of entire section in user's keymap file.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-20 19:26:08 +03:00
Andrew Borodin
6484b1dce7 Allow remove key with empty value from target config.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-20 19:26:08 +03:00
Andrew Borodin
722121a575 Define keybind numbers using enum.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-20 19:26:08 +03:00
Andrew Borodin
50de02cfe4 Unification of keybinding names.
Most of keybind names are changed to unify that names.
Details see in doc/keybind-migration.txt file.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-20 19:26:08 +03:00
Andrew Borodin
68a8745f6d Ticket #2511: simplification and unification of keybinding names.
Added doc/keybind-migration.txt file to describe new keybinding names
used in mc.keymap.* files in 4.8.x series.
Cosmetics: reordering of keymap section declarations to provide identical
order totally in the source tree.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-20 19:26:08 +03:00
Andrew Borodin
f28ec51c77 (mc_config_init): don't drop file name if file is not exist.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-03 20:48:31 +00:00
Ilia Maslakov
d31116328a Changed engine of external macros execution
Now "EditPipeBlock (X)" action tries execute the
~/.local/share/mc/mcedit/macros.d/macro.X.sh script.
To bind action EditPipeBlock (X) to the any hotkey you need add this binding
into ~/.local/share/mc/mc.macros file like following:

[editor]
ctrl-Q=EditWordLeft:-1;EditWordRightHighlight:-1;EditPipeBlock:3;
ctrl-W=EditPipeBlock:1;

This means that "ctrl-W" hotkey initiates the EditPipeBlock (1) action,
editor handler translates this into execution of
~/.local/share/mc/mcedit/macros.d/macro.1.sh shell script.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-03-03 20:48:30 +00:00
Ilia Maslakov
83177cfc16 added a new action "Record and Repeat commands", added menu entry (Record/Repeat actions) for this.
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>

some fixes

Signed-off-by: Slava Zanko <slavazanko@gmail.com>

and one more fix

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-03 20:45:07 +00:00
Ilia Maslakov
8e22a16430 Added lookup_key_by_code, now parameter is string.
For example: "ctrl-w=action:code;action:code;action:code;"

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-02 11:16:54 +00:00
Ilia Maslakov
8509b74f73 Ticket #323 (reimplimented editor macros)
Reimplemented editor macro engine:

    * added string binding "InsertChar" for action - "CK_Insert_Char"
    * added keybind_lookup_actionname - found action name by numeric constant
    * replaced struct macro to struct macro_action_t
    * added struct macros_t for describe editor scripts
    * rewritten edit_load_macro_cmd, edit_execute_macro
    * renamed edit_save_macro_cmd into edit_store_macro_cmd (WEdit * edit);
    * dropped Wedit properties: macro_i, macro_depth, macro[MAX_MACRO_LENGTH]
    * added GArray *macros_list to the store macroses of mcedit
    * added edit_get_macro

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-02 11:16:44 +00:00
Tomasz Pala
eaf889a3a2 Ticket #2509: missed names of CK_DiffQuickLeft and CK_DiffQuickRight actions
...used in keymap files.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-02 10:43:36 +03:00
Andrew Borodin
0bdbd6c608 Fixup of S-Lang initialization.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-01 15:24:44 +03:00
GoTaR
795b3a76f0 Ticket #1668: Screen and input corruption under xterm [non-UTF]
The problem:
    viewing binary files contain char 0x9A leads to massive screen corruption and Search
    dialog pops up with 1;2c search string (multiple times depending on actual screen contents).
    So it looks like the file 'presses' F7 or / and shift-right_arrow for every specified
    character combination occurrence. In case of bigger files it's impossible to exit from
    such viewer, as search dialog keeps popping up after closing.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-03-01 15:24:38 +03:00
Curtis Doty
264f90b675 Ticket #2478: HARDLINK file type
It doesn't work as documented, but instead seems to *wrongly* identify/highlight symlinks instead.
Of course, the LINK type also fails to detect hardlinks.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-02-18 15:20:33 +02:00
Ilia Maslakov
afed48a44a Ticket #2499 (action to the mark current word)
added action CK_Mark_Word to the mark current word
    changed double-click the mouse handler of the editor

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2011-02-17 21:38:06 +00:00
Andrew Borodin
20788b9bde use_mouse_p: moved definition from src/filemanager/midnight.c to lib/tty/mouse.c.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-02-05 16:54:56 +02:00
Andrew Borodin
c30c82ee48 ftpfs.c: added include of stdio.h needed for sscanf().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-02-05 16:54:56 +02:00
Andrew Borodin
77ee33e2e5 Formatting fix after indentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-02-05 16:54:56 +02:00
Andrew Borodin
5b9a7dd43f (mc_config_del_param): renamed to mc_config_del_key.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-02-05 16:54:56 +02:00
Andrew Borodin
ac8e519854 Remove extra checks before call of g_strfreev().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-02-05 16:54:56 +02:00
Andrew Borodin
d9fc47453b Optimization: get rid of triple run of isoinfo -d.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-02-04 19:25:30 +03:00
Sergey
3293c5b237 Ticket #2471: isoinfo adds ";1" to the end of file name when Joliet w/o Rock Ridge is used.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-02-04 19:25:18 +03:00
Andrew Borodin
cca5fac0e9 Missed commas.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-02-03 15:40:38 +03:00
Andrew Borodin
e3cbdfad04 Ticket #2489: colors of bold and selected text in viewer cannot be set in the command line
...using --colors option.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-02-02 14:55:06 +03:00
Yury V. Zaytsev
afd8ec8934 Ticket #2401: Make AI_ADDRCONFIG optional for RFC 3493 non-compliant systems
Unfortunately not all systems claiming POSIX support actually define
AI_ADDRCONFIG macro, and those who define it not always implement it
(this is indeed optional). This patch makes ftpfs only set AI_ADDRCONFIG
flag to speed up lookups if it is defined, and in this case, retry the
lookup if it was rejected due to unimplemented flags.

Based upon the code by Joe Orton <jorton@redhat.com> from APR:

Copyright (C) 2003 Red Hat, Inc.

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2011-02-01 10:06:33 +01:00
Andrew Borodin
912c62f564 Ticket #2459: switch to the left panel after mouse click on input line history pictogram.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-01-24 20:42:38 +03:00
Andrew Borodin
0f2578d45b Fixed parser of old colors string.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-01-24 15:46:10 +02:00
Slava Zanko
5b167ccc9e fail back to standard skin if 256-colors skin used on non256 colors terminal
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-01-24 15:46:10 +02:00
Slava Zanko
df0ae6ad0c Fixed strange incomplete code while replace colour attribute in hash
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-01-24 15:46:10 +02:00
Slava Zanko
3def2733dd Use constant for describe color intensity
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-01-24 15:46:10 +02:00
Slava Zanko
26b0623e87 Ticket #2169: Colors fixups for backward compability
* Restored old behaviour of A_BLINK attribute (intensity of background color instead of blinking foreground color);
 * Added function tty_use_256colors() for determine terminals with 256colors support;
 * Fixed background highlighting in NCurses and S-Lang.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-01-24 15:45:58 +02:00
Slava Zanko
71e70a017f renamed cedit.menu to mcedit.menu
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-01-20 17:44:04 +02:00
Slava Zanko
4dcb7c9337 Added environment variable MC_LOG_ENABLE for specify if logging is enabled
(higher priority rather then parameter from config file). Also added environment
variable MC_LOG_FILE for specify file name.

In additional, new section [Development] now handled. For specify if logging enabled, use

[Development]
 logging = true

instead of [Midnight Commander].development.enable_logging option (WARNING: handling of
this option was removed in this commit!)

For specify file name use

[Development]
 logfile = /path/to/file

If file name isn't specified, then default value will used (~/.cache/mc.log)

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-01-20 17:38:27 +02:00
Slava Zanko
cf162ef810 Added new function mc_always_log() for logging on early bootstrap stages
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-01-20 17:38:27 +02:00
Slava Zanko
c8982e822c Updated docs (man pages and comments in source code)
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-01-20 17:38:27 +02:00
Slava Zanko
f31863a80a Renamed variables mc_home to mc_sysconfig_dir and mc_home_alt to mc_share_data_dir for more sence
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-01-20 17:38:27 +02:00
Slava Zanko
acbe048486 Ticket #1851: Home config directory [xdg-user-dirs]
Instead of hardcoded (via MC_USERCONF_DIR) path mc mc now used
dynamic directories specified by environment variables:
 * XDG_CONFIG_HOME - dir for config files . By default is ~/.config/mc
 * XDG_DATA_HOME - dir for some data, such as user defuned Syntax file, menu etc By default is ~/.local/share/mc
 * XDG_CACHE_HOME - dir for temp files, such as cooledit.clip etc. By default is ~/.cache/mc

This is mainstream standard already adopted by many projects.

Old settings will be migrated at first time from ~/.mc to these dirs.

See http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html for more info.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-01-20 17:38:27 +02:00
Andrew Borodin
16c13be47b Added option to change mode of panel swap.
New "Simple panels swap" checkbox in "Panel options" configuration
dialog window. Unchecked by default.

Documentation update.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-01-08 16:29:18 +03:00
Vladislav Grishenko
73eae56a99 Ticket #1634 (BS, Del incorrect works in CP866 locale)
fixed trouble with BS and Del in dialog input fields (in CP866 locale).

Signed-off-by: Vladislav Grishenko <themiron@mail.ru>
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2011-01-05 23:09:53 +00:00
Andrew Borodin
41177e0c06 Ticket #2457: alt-backspace doesn't work.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-01-04 11:45:49 +03:00
Ilia Maslakov
03363eac71 added action EditRedo.
added functions:
        * edit_push_redo_action
        * edit_pop_redo_action
        * edit_do_redo

    removed not supported (not actual) code

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-12-30 21:23:42 +00:00
Andrew Borodin
8c1fba1ffa Optimization of old color look-up.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-12-29 13:58:42 +03:00
Andrew Borodin
da2c82e8d3 Ticket #2170: color of panel header cannot be set in the command line
...using --colors option.

Grammar in default skin description.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-12-29 13:58:28 +03:00
Egmont Koblinger
e593572bb9 Ticket #2169: Add support for 256 colors terminals
Forget the old limit of 8 background and 16 foreground colors.
From now on Midnight Commander can use all the 256 colors,
as your favorite terminal emulator supports them - or not,
in which case it's not going to stay your favorite terminal for long.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-12-29 11:58:10 +02:00
Andrew Borodin
0f9af9315c (fish_fill_names): remove unexpected break.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-12-28 11:33:50 +03:00
Andrew Borodin
4c83f8b4df (panel_save_curent_file_to_clip_file): 'res' might be used uninitialized here.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-12-28 09:10:43 +03:00
Jindrich Novy
a3344024c1 fix VFS crashes.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-12-27 15:57:16 +03:00
Andrew Borodin
71a2eeec21 Replaced remaining grep with @GREP@ in iso9660 VFS plugin.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-12-27 15:57:16 +03:00
Andrew Borodin
7a8dc2665e Ticket #2447: code cleanup before 4.7.5 release.
VFS: post-indentation fixups.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-12-27 15:57:09 +03:00
Andrew Borodin
65d4e1752d (input_key_is_in_map): don't execute any input actions here.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-12-23 13:24:50 +03:00
wjaguar
4de95fe89f Ticket #1963: use grep instead of awk in iso9660 extfs plugin.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-12-14 16:16:38 +03:00
Ilia Maslakov
424069e958 examine results of perl script execution.
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-12-07 15:54:23 +00:00
Ilia Maslakov
73fee4232c Ticket #2031 (FISH fix for Sun Solaris)
Removed bashism, fixed incorrect work under Solaris.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-12-07 15:54:01 +00:00
Ilia Maslakov
f153e1ad29 renamed:
* PanelCtrlNextPage into PanelGotoChildDir
    * PanelCtrlPrevPage into PanelGotoParentDir

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-12-04 09:06:06 +00:00
Ilia Maslakov
2690d2d9f5 Ticket #2375 (do cd .. if command line is empty)
New keybinding "PanelSmartJumpUp" for the jump to the parent directory if command line is empty. Not defined by default.
    This binding maybe used for bind 'Backspace' as hotkey for 'cd ..' (only if command line is empty).

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-12-04 09:05:07 +00:00
Andrew Borodin
72ee546a59 Ticket #2419: configure script doesn't set samba configdir.
lib/vfs/mc-vfs/samba/configure can't set the value of SAMBA_CFLAGS
in lib/vfs/mc-vfs/Makefile.am.

The solution: to avoid configuration code duplication, use environment
variables SMBCONFIGDIR and SMBCODEPAGEDIR to set up values of configdir
and codepagedir variables in lib/vfs/mc-vfs/samba/Makefile because
samba configure is child process of main configure.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-12-03 15:36:47 +03:00
Andrew Borodin
fe8c5390ad Fix of uintmax_t variables output.
Use PRIuMAX and PRIXMAX instead of ju and jX modifiers respectively
for formatted output of uintmax_t variables.
If PRIXMAX is not defined (i.e. in Solaris9), use PRIxMAX instead.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-12-03 10:58:39 +03:00
Andrew Borodin
6e6ec057cb Avoid compiler warnings.
(file_mask_dialog): do_background argument shadows do_background()
function; renamed to do_bg.

(label_callback): unitialized variable.

(read_filesystem_list): const char *.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-12-02 22:12:56 +03:00
Andrew Borodin
d8ce7e5e4e Include stdio.h for fprintf().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-12-02 21:59:42 +03:00
Andrew Borodin
ed87b08a14 Fixed declaration of mouse callback type
...and minor indentation.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-12-02 21:59:42 +03:00
Andrew Borodin
62c05d62f3 Ticket #2409: fix of GModule detection and usage.
Don't mix GLib and GModule compiler and linker options.

Use gmodule-no-export if present to avoid use -Wl,--export-dynamic
option with some linkers. If gmodule-no-export is not available,
use generic gmodule.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-12-02 21:59:42 +03:00
Andrew Borodin
380d9bd885 Ticket #2171: colors for popup menu:
... for menu items, selected menu item and for menu title.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-12-02 09:55:59 +03:00
Andrew Borodin
12ccfdff6c Ticket #2429: overflow of file operation counters.
Use uintmax_t type instead of double for summary size of several files.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-12-02 09:41:51 +03:00
Andrew Borodin
15013927e7 Include inttypes.h instead of stdint.h.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-26 11:31:18 +03:00
Slava Zanko
bbf1f4e857 Moved filemanager-related stuff to src/filemanager directory
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-11-24 10:51:32 +03:00
Andrew Borodin
fdb61594df Cleanup of main.[ch].
All file panels related stuff was moved to midnight.[ch].

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-11-24 10:51:31 +03:00
Slava Zanko
b1bd2e2673 Removed hardcoded actions on ctrl-d and ctrl-h hotkeys. Now these hotkeys defined in keymap file.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-11-24 10:51:31 +03:00
Slava Zanko
0ef9273598 Changes for avoid compiler warnings
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-11-24 10:51:31 +03:00
Slava Zanko
08e9759283 Split file src/keybind.[ch] to lib/keybind.[ch] and src/keybind-defaults.[ch].
File src/cmddef.h now merged to lib/keybind.h

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:51:31 +03:00
Slava Zanko
62f3c368c9 Renamed keybind-related functions:
* lookup_action          -> keybind_lookup_action
* lookup_keymap_shortcut -> keybind_lookup_keymap_shortcut
* lookup_keymap_command  -> keybind_lookup_keymap_command

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-11-24 10:51:31 +03:00
Slava Zanko
045debaa8a Moved charsets.[ch] from src to lib directory
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-11-24 10:51:31 +03:00
Slava Zanko
dc0a963304 Refactoring: removed unused variable
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-11-24 10:51:31 +03:00
Andrew Borodin
139fdaa6bd History optimization.
Don't create conversion handler for each history line while reading
and saving history.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:51:31 +03:00
Andrew Borodin
1ae9172d2a Renamed mc_config_direct_set_string() to mc_config_set_string_raw()
... and avoid any string modification before save to ini.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:51:30 +03:00
Andrew Borodin
bbb6233049 Optimization of confguration library: delete extra checks
...and simplified codeset conversion in mc_config_get_string().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:51:30 +03:00
Andrew Borodin
3d92a0846a Menu improvements.
menubar_set_visible(): new function to get rid of menubar_visible global variable
in widgtes library.

menu_set_name(): new function to avoid total recreation of main menu
after change panel layout.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:51:30 +03:00
Andrew Borodin
f70e06b37a Optimization of str_msg_term_size().
Use single function to calculate of text lines and columns
because algorithm is the same for all encodings.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:51:30 +03:00
Andrew Borodin
f24dd62dc2 Use str_msg_term_size() instead of msglen()
... because msglen() is not tolerant to multi-byte encodings.
Remove msglen() because it unused now.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:51:30 +03:00
Andrew Borodin
71364f88c3 Split lib/widget/widget.[ch] and lib/widget/wtools.[ch] files
...into small: one widget in one file.
Renamed most if WInput functions.
Minor optimization.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:51:30 +03:00
Andrew Borodin
8d1708225c Don't include lib/util.h via lib/global.h.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:51:30 +03:00
Andrew Borodin
7660a8ce66 lib/util.h: deleted unused defines.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:51:30 +03:00
Andrew Borodin
1685730d7c OS-specific defines are moved from lib/util.h into lib/global.h.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:51:30 +03:00
Andrew Borodin
50c128a01f is_exe() is inline now.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:51:30 +03:00
Andrew Borodin
d154b0f676 exist_file() is inline now.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:51:30 +03:00
Andrew Borodin
d543be11d9 Use g_file_get_contents() instead of load_file().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:51:30 +03:00
Slava Zanko
8b018db98f Some WIDGET-related stuff moved to lib/widget directory
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-11-24 10:51:30 +03:00
Andrew Borodin
43ed65e3d9 Moved string-related routines from lib/util.[ch] into lib/strutil.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:51:29 +03:00
Andrew Borodin
593157d8cb lib/util.[ch]: removed unused functions.
str_unconst(), trim(), cstrstr() and cstrcasestr() are unused and
removed.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:51:29 +03:00
Slava Zanko
c57566af00 Avoid compiler warnings.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:27:47 +03:00
Matthieu Crapet
32a9d93978 VFS: Added 7zr executable detection in u7z
On many distributions by default only the reduced version of p7zip (7zr)
is installed (e.g. on Debian p7zip package provides 7zr executable and
p7zip-full package provides 7za executable).

This patch adds the detection of 7zr in case if 7za is not available.
2010-11-24 10:27:47 +03:00
Andrew Borodin
d169d13296 Use str_trunc() directly instead of name_trunc().
name_trunc(): removed.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:27:47 +03:00
Andrew Borodin
53ad349a36 Moved time related stuff from lib/util.[ch] into lib/timefmt.[ch].
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:27:47 +03:00
Andrew Borodin
97aa4e99c9 Use g_strndup() directly instead of str_dup_range.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:27:47 +03:00
Andrew Borodin
8425e6fc71 Moved PATH_MAX definition from lib/util.h into lib/fs.h.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:27:47 +03:00
Andrew Borodin
9b43d71799 Set SLtt_Ignore_Beep in tty_init().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:27:47 +03:00
Andrew Borodin
9ec4d4c08b Check variable before g_array_free() call.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:27:47 +03:00
Andrew Borodin
79133154b0 Moved hooks from lib/util.[ch] to new files lib/hook.[ch]
... and renamed Hook to hook_t.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:27:46 +03:00
Andrew Borodin
34c1e1a38a Removed unused enum.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:27:46 +03:00
Andrew Borodin
5e0c9c911d Moved declaration of "easy_patterns" variable from lib/util.[ch] to src/setup.[ch].
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:27:46 +03:00
Andrew Borodin
1f4efb3a46 (mc_skin_ini_file_load): minor optimization.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:27:46 +03:00
Andrew Borodin
1192d34bd1 Clean up some empty lines.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:27:46 +03:00
Slava Zanko
ed566f8971 mc_fhl_init_from_standard_files(): fixed logic and file read order for config files
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:27:20 +03:00
Slava Zanko
feb733663f Code indentation in lib directory
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-11-24 10:27:20 +03:00
Andrew Borodin
8ed0510df5 Optimization of mc_fhl_array_free().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:27:20 +03:00
Andrew Borodin
4892044e71 Remove extra check before mc_search free() call.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:27:20 +03:00
Andrew Borodin
4c0ba932a8 Remove extra check before call mc_config_deinit()
...and minor cleanup of related code.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:26:27 +03:00
Andrew Borodin
5324bc63bf (mc_fhl_read_ini_file): conditions cleanup.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:26:27 +03:00
Andrew Borodin
b8a6d0e27d Grammar.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:26:27 +03:00
Andrew Borodin
eea82529d1 Ticket #2409: prepare to the 4.7.5 release.
(mc_fhl_parse_get_extensions): fixed possible memory leak and minor
optimization.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-24 10:26:27 +03:00
Andrew Borodin
3e7d76eb13 Ticket #2197: added new color for status bar
...and added missed colors for button bar.

Updated EN and RU man pages.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-22 16:07:17 +03:00
Andrew Borodin
5468707bc6 Added comment for translators about "at sign" symbol.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-02 13:34:08 +03:00
Andrew Borodin
0908c8baea Ticket #2404: added forgotten shotrcuts of mcedit.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-01 21:31:24 +03:00
Andrew Borodin
54a9e72250 Some optimization of loops in translation functions.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-01 15:48:39 +02:00
Andrew Borodin
b6fd832a8a Create strings with small preallocated sizes.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-01 15:48:39 +02:00
Andrew Borodin
69cebb9984 mc_search__cond_struct_new_regex_ci_str(): get rid of extra string duplication.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-11-01 15:48:38 +02:00
Andrew Borodin
5cac8caabe Minor optimization of translation function arguments.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-01 15:48:38 +02:00
Slava Zanko
601047b6a1 Avoid extra-allocation of string while prepare to regexp-search.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-11-01 15:48:38 +02:00
Slava Zanko
8d59d66188 Removed mc_search_cond_t->len (used mc_search_cond_t->str->len instead).
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-11-01 15:48:38 +02:00
Slava Zanko
863f1ec174 Fixed bit operations in mc_search_regex__process_append_str()
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-11-01 15:48:38 +02:00
Slava Zanko
3934c6fb8e Ticket #2396 (Find File "Whole words" search bug)
when searching in files for non english word with "Whole words" set "on" - then nothig will be found
try search word: "время" and also "time" in next example:

'time'
Время
'Time'
'время'

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-01 15:48:38 +02:00
Andrew Borodin
4aec2187e1 Ticket #1894: sort order should not mix hidden files with others.
In case sensitive sort, the order of files and directories is following:
hidden dirs
dirs
hidden files
files

In case insensitive mode, directories are mixed and files are mixed too:
dirs (hidden and not are mixed)
files (hidden and not are mixed).

This commit defines the sort order independently of case sensitivity:
hidden dirs
dirs
hidden files
files

Files in UTF-8 locale require special handling: leading dot must not be
processed in g_utf8_casefold() funcion.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-01 15:02:57 +03:00
Andrew Borodin
8f54b9b0b5 lib/lock.c: applied MC indentation policy.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-01 13:54:39 +03:00
Andrew Borodin
533567c1a7 Expand tilde while locking and unlocking files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-11-01 13:54:39 +03:00
Ilia Maslakov
88dc2e93bd replace print_vfs_message to printf
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-10-27 18:12:02 +04:00
Andrew Borodin
8be556abc5 Declarations of use_dash() and rotate_dash() were moved form lib/util.h to src/layout.h.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-10-27 18:10:50 +04:00
Ilia Maslakov
8b46518619 Apply code identation policy.
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-10-27 18:10:50 +04:00
Andrew Borodin
0a5f93eeb5 fish.c: some fixups.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-10-27 18:10:50 +04:00
Ilia Maslakov
3cef64306e Split function fish_open_archive_int() to fish_open_archive_pipeopen() and fish_open_archive_talk().
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-10-27 18:10:50 +04:00
Ilia Maslakov
3ba4abac41 Ticket #2268 (FISH: hide panels before connecting)
FISH: now hide the panel before connecting.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-10-27 18:10:49 +04:00
Denys Vlasenko
12891835f4 Ticket #2327: Can't put ? into a new name.
The bug is caused by extra "continue" statement in case '*'/case '?' branch.
As a result, \ is added to converted string, but following N is not.
Example: when one renames many files using "*" to "a*z", "a*z" gets converted to "a\z" instead of correct "a\1z"

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-10-27 13:48:32 +03:00
Andrew Borodin
185d5fc359 Install help files into /usr/share/mc/help instead of /usr/share/mc.
Optimisation of language-specific help file creating.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-10-19 18:25:59 +04:00
Andrew Borodin
280194ec15 Install hint files into /usr/share/mc/hints instead of /usr/share/mc.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-10-19 18:25:59 +04:00
Andrew Borodin
9636ca2583 Load locale-specific info (help and hints) from /usr/share/mc only.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-10-19 18:25:59 +04:00
Andrew Borodin
bfbac0c5d8 Reimplemened codepages storage using GPtrArray.
Added capability to load codepage list from /usr/share/mc/mc.charsets
and /etc/mc/mc.charsets and merge them then.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-10-19 18:25:53 +04:00
Andrew Borodin
245f465d6e Install mc.charsets into /usr/share/mc instead of /etc/mc.
Renamed CHARSETS_INDEX macro to CHARSETS_LIST.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-10-19 18:15:37 +04:00
Egmont Koblinger
aa9cb6d320 Ticket #2170: Color collisions
Midnight Commander's color/skin engine often reuses the same color definition for multiple elements on the UI.
This unnecessarily limits the possibilities when playing with colors.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-10-13 13:21:10 +03:00
Enrico Weigelt, metux IT service
fb05515d82 lib/vfs/mc-vfs/smbfs.c: fixed printf() arguments.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-10-11 11:00:29 +03:00
Andrew Borodin
9678ef3b02 Fixed type mismatches in formatted output arguments in VFS.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-10-11 11:00:29 +03:00
Slava Zanko
a8aa5cf678 Added definition MC_MAXFILENAMELEN for specify maximum file lenght.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-10-11 10:38:30 +03:00
Andrew Borodin
a09f5f372b Some optimization and cleanup of color-related code in skin layer.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-10-06 12:15:55 +03:00
Andrew Borodin
4a175cbbe6 Some optimization and cleanup of color-related code in TTY layer.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-10-06 12:15:55 +03:00
Ilia Maslakov
3013a364b0 Merge commit 'origin/2287_persistent_bookmarks'
* commit 'origin/2287_persistent_bookmarks':
  Fix in lib/logging.c for proper work on 64-bit platforms.
  Change of bookmark drawing.
  Fixed memory leak: destroy serialization bookmarks if file position is not saved.
  Use GArray for bookmarks instead of raw array.
  Minor optimization, type accuracy, includes fix.
  Ticket #2287 (mcedit: persistent bookmarks)
2010-09-28 18:33:53 +04:00
Slava Zanko
b8836ec6c5 Fix in lib/logging.c for proper work on 64-bit platforms.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-09-28 14:12:32 +04:00
Andrew Borodin
ec8d6f0751 Get rid of some '#ifdef ENABLE_VFS' conditions.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-09-27 21:44:20 +04:00
Andrew Borodin
c36a810c09 Fix of file panel encoding change w/o VFS support.
Now --disable-vfs doesn't mean the total disabling of VFS.
With --disable-vfs option, the localfs module is built
to use the change of file panel encoding.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-09-27 21:43:43 +04:00
Andrew Borodin
48318f3e5d Cleanup of includes in VFS sources.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-09-27 21:43:43 +04:00
Andrew Borodin
268c364292 Fix of VFS encoding parsing.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-09-27 21:35:11 +04:00
Andrew Borodin
5007553299 Remove only supported encodings from path.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-09-27 21:34:40 +04:00
Andrew Borodin
aff8e42d64 Created macro VFS_ENCODING_PREFIX for "#enc:" encoding prefix.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-09-27 21:33:16 +04:00
Andrew Borodin
c0384e0b6b When cd to "..", remove encoding at the end of path.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-09-27 21:33:16 +04:00
Ilia Maslakov
ee80601316 Removed useless g_free() calls
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-09-27 14:33:24 +04:00
Ilia Maslakov
47b7e46b3f Ticket #2347 (hardcoded fish scripts is outdate)
fixed: hardcoded fish scripts in lib/vfs/mc-vfs/fishdef.h

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-09-27 14:33:17 +04:00
Andrew Borodin
ed18e2d093 Use GArray for bookmarks instead of raw array.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-09-17 17:13:10 +04:00
Andrew Borodin
3af16693e2 Minor optimization, type accuracy, includes fix.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-09-17 17:13:09 +04:00
Filip Sefrna
a4651d8d2b Ticket #2287 (mcedit: persistent bookmarks)
Save bookmarks of internal edit in filepos

Signed-off-by: Filip Sefrna <fsefrna@gmail.com>

Type accuracy.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-09-17 17:13:09 +04:00
Yury V. Zaytsev
e0d1d53cbf Added myself to the authors list
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2010-09-15 13:49:03 +02:00
Yury V. Zaytsev
6586dcf78b Fixed DATA connection initialization logic
Factored out error checking from ftpfs_initconn into
ftpfs_init_data_socket and fixed the logic of the initialization of DATA
connection. Now initialization of passive connection is retried if
needed after the failure to open the socket.

Got rid of goto statements and divided the code in two parts (passive &
active). Initial state is now properly restored after the function runs.

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2010-09-15 13:49:02 +02:00
Yury V. Zaytsev
a27725d7a3 Refactored IPV4/IPV6 FTP connection setup code
Miscellaneous refactoring:

    * Factored out the active IPV4/IPV6 FTP connection mode setup
      routine in a separate function (ftpfs_setup_active) to make the
      logic more clear.

    * Factored out ftpfs_init_data_socket from ftpfs_initconn in order
      to make it possible to fix the logic later on.

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2010-09-15 13:49:02 +02:00
Yury V. Zaytsev
ada1848268 Fixed passive FTP connection logic
In current implementation few issues were fixed making passive
connection scheme more reliable:

    * If it's IPV4, try PASV first, as some servers and ALGs get
      confused by EPSV, and only then EPSV as a fallback

    * When trying PASV or EPSV, actually try to connect to the provided
      port and if the connection fails, still try the next method

    * PASV and EPSV response parsing code was factored out in separate
      routines for clarity

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2010-09-15 13:49:02 +02:00
Yury V. Zaytsev
a402ebc981 Ticket #121: Fixed IPV4 FTP connection scheme
* Fixed endianness issue introduced by IPV6 patch, which prevented
      active connections to be established via PORT mechanism.

      FTP server always expects to see the port broken down into bytes
      in network byte order, so the transformation to host byte order is
      only needed when using EPRT.

    * Some IPV4 FTP servers and FTP ALGs / NATs with connection tracking
      become confused when you try to use EPSV or EPRT instead of PASV or
      PORT respectively.

      This commit changes current FTP connection scheme: if we deal with
      an IPV4 host, instead of first trying to use EPRT, first try to
      use PORT and only if it fails try EPRT as a fallback.

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2010-09-15 13:49:02 +02:00
Andrew Borodin
490ab7618b check_movement_keys() function is unused. Removed.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-09-01 15:25:59 +04:00
Andrew Borodin
2f62fadabb Ticket #212: implemented keybindings for WListbox widget.
Initial step: added description for A1 and C1 keys.
A1 and C1 keybindings are applied to WTree, WInput and WPanel widgets.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-09-01 15:20:27 +04:00
Oswald Buddenhagen
9c3b434197 Ticket #2273: Restore signals even if fork() fails.
The -1 is not sent through WEXITSTATUS() in case of wait()
failing any more. I think that's the original intention.
2010-07-30 19:26:09 +04:00
Andrew Borodin
232ca56501 Ticket #123: fixed types to avoid file size limitation in VFS layer.
Fixed modifiers and removed types recastin in envoronment
variables and messages forming.
Minor code cleanup.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-07-29 12:57:04 +04:00
Andrew Borodin
da8e14bcbb Define ENABLE_VFS_NET in C code not in M4 one.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-07-24 09:27:27 +04:00
Andrew Borodin
11c00959f3 Fixup of conditions for networking VFS.
Clean up of code duplicate in configure.ac.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-07-21 16:43:50 +04:00
Slava Zanko
12446899f7 Changes for configure and build with samba:
* m4: AC_CONFIG_SUBDIRS() macros should be always called without relation to enable/disable samba support
 * vfs/samba: configure.ac: renamed --with-configdir to --with-smb-configdir
 * vfs/samba: configure.ac: renamed --with-codepagedir to --with-smb-codepagedir

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-07-21 16:43:50 +04:00
Enrico Weigelt, metux IT service
9b89d60522 VFS: cleaned up smbfs.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-07-21 16:43:50 +04:00
Enrico Weigelt, metux IT service
67d6ebfd16 VFS: fishfs can now be switched off
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-07-21 16:43:50 +04:00
Enrico Weigelt, metux IT service
05516fbac8 VFS: ftpfs can now be switched off
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-07-21 16:43:50 +04:00
Enrico Weigelt, metux IT service
bc1de7cd78 VFS: extfs can now be switched off
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-07-21 16:43:50 +04:00
Enrico Weigelt, metux IT service
6f289617d2 VFS: sfs can now be switched off
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-07-21 16:43:50 +04:00
Enrico Weigelt, metux IT service
f33f7a5031 VFS: tarfs can now be switched off
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-07-21 16:43:50 +04:00
Enrico Weigelt, metux IT service
19390ab2d7 VFS: cpiofs can now be switched off
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-07-21 16:43:50 +04:00
Slava Zanko
f7ac8acd29 Type accuracy in undelfs vfs.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-07-21 16:43:50 +04:00
Enrico Weigelt, metux IT service
5df06e7630 VFS: fixups of UNDELFS VFS switch on/off.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-07-21 16:43:50 +04:00
Andrew Borodin
7d765e4050 Cleanup of lib/vfs/mc-vfs/Makefile.am file.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-07-21 16:43:50 +04:00
Andrew Borodin
699ecb5e21 VFS: Type accuracy in netutil.[ch].
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-07-21 16:43:50 +04:00
Enrico Weigelt, metux IT service
bd8a2d4c79 VFS: Moved vfs_split_url() function from netutil.c into utilvfs.c.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-07-21 16:43:50 +04:00
Andrew Borodin
9df2f96e75 Some reorginizing of VFS private and public APIs.
Clean up of remained mcfs support.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-07-21 16:43:49 +04:00
Andrew Borodin
57281c6e0b Added type for VFS class flags.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-07-21 16:43:49 +04:00
Ilia Maslakov
0795cc2bc9 Ticket #2267 (fish: resume download)
implemented resuming file downloads (reget) in FISH VFS

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-07-20 18:31:28 +00:00
Andrew Borodin
17d8107e8d Ticket #171: fixed remained plain int types in VFS.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-07-20 09:26:38 +04:00
Andrew Borodin
6a55c9320e Ticket #2279: mcserver is deprecated.
Removed mcserver and mcfs support.

Reasons:
(1) no longer builds
(2) no one is willing to support it
(3) possibly contains unfixed security holes
(4) makes no sense in view of the availability of FISH

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-07-17 18:36:54 +04:00
Andrew Borodin
298e83f40b Added color for disabled widget.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-07-17 15:27:21 +04:00
Oswald Buddenhagen
69903712b9 Ticket #2274: Adjust extfs script modes to installed permissions
Some extfs script modes in the repository differ from the ones they get
when installed. This is annoying for those, who hardlink files to the
installed location instead of copying, because git status will show
these files as modified.

Fixing permissions in the repository will resolve this issue.

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2010-07-12 20:25:38 +02:00
Slava Zanko
c5dfdac5fc Ticket #2123: Fix to properly parse the replacement string
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-07-08 22:15:09 +03:00
Slava Zanko
5c95084e2f Fixed bug with copy dir '\\\\' to anoter. Directoty whis this name was automatically renamed to '\\'
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-07-07 16:43:00 +03:00
Slava Zanko
3facc59837 use g_string_sized_new() instread of g_string_new() to avoid often reallocation action
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-07-07 14:12:45 +03:00
Slava Zanko
3aa6758f4f identation of code
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-07-07 14:06:41 +03:00
Slava Zanko
973bbb70a2 Ticket #2123: crash while copying into directory named "????"
1. create directory named "????" and enter into this directory
2. point at any file in other panel
3. press F5 and Enter
Segfault

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-07-07 14:06:41 +03:00
Slava Zanko
41adaf7493 Added missing files for making tarballs
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-07-05 22:40:58 +03:00
Andrew Borodin
8be8851b2a Removed unused vfs_die() function from mcserv.c.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-07-05 21:35:18 +04:00
Andrew Borodin
e73bfb2486 Fixed some i18n stuff.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-07-05 21:35:18 +04:00
Andrew Borodin
63c290fef2 The major number of device wasn't initialized in parsing of 'list' command output.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-07-05 21:35:18 +04:00
Vit Rosin
76810bbf8b Ticket #2039: check returned value of g_path_get_basename().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-07-05 21:35:18 +04:00
Andrew Borodin
ec7b039588 Ticket #2243: code cleanup before 4.7.3 release.
Removed unneeded breaks from switch operators.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-07-05 21:35:18 +04:00
Ilia Maslakov
ce0ac8e66d Applied MC indentation policy.
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-07-05 16:49:01 +00:00
Yury V. Zaytsev
8c9ac5ec55 Updated protocol description in README.fish
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-07-05 15:36:14 +00:00
Ilia Maslakov
36d59acf97 Ticket #2242 (improved FISH)
fixed configure.ac
    added lib/vfs/mc-vfs/fish/Makefile.am lib/vfs/mc-vfs/fishdef.h
    moved lib/vfs/mc-vfs/fish/README.fish
    fixed lib/vfs/mc-vfs/Makefile.am
    added external scripts in lib/vfs/mc-vfs/fish/
        * ls - get gile list
        * mkdir - make directory
        * rmdir - remove directory
        * unlink - delete file
        * chown - change owner/group of file
        * chmod - change mode of file
        * mv - move file
        * ln - make symlink
        * hardlink - make hardlink
        * send - copy file to target host
        * append - append file to target host (if exists)
        * get - copy file from target host
        * info - return resalts of scan remote host (have: perl, sed, awk, etc)

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>

fish.c: optimization and code cleanup
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>

optimization of FISH environment variables.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-07-05 15:35:42 +00:00
Oswald Buddenhagen
807ccb469c Ticket #2249: fix crash at startup
str_8bit_strdown() returned an incorrect value.
2010-06-30 10:15:46 +04:00
Andrew Borodin
b2ee413f03 Allow use file locking in various components of MC.
Renamed and moved src/editor/editloc.[ch] -> lib/lock.[ch].
Renamed lock handling functions.
Fixed library order in src/Makefile.am.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-06-22 21:44:22 +04:00
Andrew Borodin
936bb2e5f0 Added code names for parentheses, brackets and braces.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-06-22 21:16:19 +04:00
Andrew Borodin
0cb04aec3b g_strncasecmp() function is deprecated.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-06-08 13:07:11 +04:00
Andrew Borodin
8b4124dfa5 g_strup() function is deprecated. g_ascii_strup() is used instead.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-06-08 13:07:11 +04:00
Andrew Borodin
3ddec0f89d g_strcasecmp() function is deprecated.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-06-08 13:07:11 +04:00
Vit Rosin
77575277e2 g_strdown() function is deprecated.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-06-08 13:07:11 +04:00
Andrew Borodin
aa0d96bd8b Ticket #1646: removed leading and trailing spaces in i18n resources.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-06-07 21:42:46 +04:00
Andrew Borodin
7e5f4a01c0 i18n of search error messages.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-06-04 23:34:28 +04:00
Andrew Borodin
c48763fa9d mc_util_write_backup_content(): fixed arguments in fwrite() call.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-06-04 23:33:48 +04:00
Andrew Borodin
df6bbf38eb Ticket #2225: code cleanup before 4.7.0.6 release.
Fixed indentation.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-06-04 23:32:38 +04:00
Andrew Borodin
8657fd5f01 Ticket #2203: VFS: use codepage list loaded from mc.charsets file.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-05-28 14:55:16 +04:00
Ilia Maslakov
a4e4378861 initial step to do mark in inpun fields
added selection with mouse

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>

    Code cleanup: make visibility of some functions as static

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>

fixed skins

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-05-27 22:26:59 +03:00
Ilia Maslakov
72bb075828 Ticket #2161 (del - clear input field)
new behavior: DEL - clear current field of dialog if text in the field is not modify and cursor not moved.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>

Code cleanups: avoid compiler warnings

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-05-27 22:26:59 +03:00
Andrew Borodin
2c7bc9c1c2 Ticket #2157: fixed tty_fill_region() for ncurses-based TTY layer.
If filled region is larger than screen, NCurses doesn't fill it
unlike S-Lang. This patch fixes such behaviour: only visible part
of region is filled.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-05-19 21:25:50 +04:00
Andrew Borodin
7843203257 mc_ungetlocalcopy(): fixed wrong condition.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-05-16 11:24:50 +04:00
Andrew Borodin
6a306c18b2 old_esc_mode option can be setup now in 'Configure options' dialog.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-05-14 18:46:15 +04:00
Andrew Borodin
2b167cbef0 Configuration dialogs reorganization.
Panel options are moved to new dialog.
Panel setup options are collected in a special structure.
Includes clean up.
Code indentation.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-05-14 18:46:15 +04:00
Andrew Borodin
be622a9981 Refactoring of configuration handling.
Some functions were renamed. Code was reorganized.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-05-14 18:44:43 +04:00
Andrew Borodin
9db9fd766e Applied MC indentation policy.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-05-14 12:12:53 +04:00
Andrew Borodin
d2b23924dd Ticket #1911: use system realapth(3) function if available.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-05-14 12:08:43 +04:00
Slava Zanko
2a8a4131b2 Direct cleanup in master branch
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-05-05 21:52:27 +03:00
Slava Zanko
8f48bf2aec Fixed errors and warnings in compilation stage.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-05-05 16:24:14 +04:00
Andrew Borodin
873880edc2 vfs_timeout and use_netrc variables were moved to vfs.h file.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-05-05 16:24:14 +04:00
Andrew Borodin
9ac5d5207c Minor optimization of tty_draw_box() function.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-05-05 16:24:14 +04:00
Vit Rosin
2eb870c9c9 Ticket #2041: check return value of g_strdup_printf() in mc_log().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-05-05 16:24:14 +04:00
Vit Rosin
993d678ed9 Use EXIT_FAILURE symbolic name as return code.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-05-05 16:24:14 +04:00
Andrew Borodin
9547a991cb Ticket #2119: some trivial corrections.
Trivial changes in util.h. Type cast in str_move function.

Thanks Vit Rosin for original patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-05-05 16:24:14 +04:00
Andrew Borodin
933aba001d Some optimizatioms in vfs.c.
Avoid some else branches. Type accuracy.

Thanks Vit Rosin for original patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-05-05 16:24:14 +04:00
Andrew Borodin
e70db42deb Grammar.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-05-05 16:24:13 +04:00
Andrew Borodin
4cea5be1ac Ticket #2097: clean up before 4.7.2 release.
Split assignments and conditions. Type accuracy. Minor optimization.

Thanks Vit Rosin for original patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-05-05 16:23:51 +04:00
Slava Zanko
3a1e0966ae Final Indentation of all touched files
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-05-04 17:34:21 +03:00
Enrico Weigelt, metux IT service
303833d590 Ticket #1897: Build breaks on ignored return values
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>
2010-05-04 17:34:20 +03:00
Yury V. Zaytsev
28eda66803 Ticket #1671: i18n_checktimelength may vary depending on the season
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>
2010-05-02 13:21:09 +02:00
Andrew Filonov
d9ebcebdc1 Another side of this bug, missed before
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-04-30 10:49:16 +03:00
Andrew Filonov
fc6cf6bf3f Ticket #2122: Y2k bug in uzip vfs
Newest version of unzip returns year of file with 4 digits.
But regexp in uzip checks only 2 digits.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-04-30 10:49:16 +03:00
Ilia Maslakov
329ef3846a Ticket #120 (View diff files)
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>
2010-04-26 11:44:15 +04:00
David Sterba
2a465cb8b5 Ticket #2149: patches adding a single line are not shown correctly by patchfs.
The problem:

$ cat < test.diff
--- a/foo
+++ b/foo
@@ -0,0 +1 @@
+bar

$ mcview test.diff#patchfs/a/foo.diff
--- a/foo
+++ b/foo

'+bar' line is not shown.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-04-25 10:07:49 +04:00
Andrew Borodin
b266527c5f Applied MC indentation policy.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-04-23 11:54:25 +04:00
Andrew Borodin
c0c744ba08 Ticket #1660: color keyword names unification.
Changed name of following color keywords:

menu -> menunormal
linestate -> editlinestate

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-04-22 16:09:52 +04:00
Artem S. Tashkinov
07de6670ed Ticket #2050: extfs/urar: disable user/system configuration for list and copyout operations.
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>
2010-04-22 10:18:46 +04:00
Artem S. Tashkinov
8bdd7bc764 Ticket #2049: extfs/urar doesn't correctly shows localized filenames in RAR archives.
There's no need to export LC_ALL.

Signee-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-04-20 16:56:41 +04:00
Andrew Borodin
7161567ea8 Ticket #1648: fixed frame corners for NCurses screen library.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-04-14 14:38:22 +04:00
Andrew Borodin
a708b5c514 Applied MC indentation policy.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-04-06 11:16:11 +04:00
Andrew Borodin
b0be11acd5 Merged tty_draw_double_box() function into tty_draw_box() one.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-04-06 10:30:58 +04:00
Andrew Borodin
4e57b599cc Renamed frame symbol names.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-04-06 10:30:58 +04:00
Andrew Borodin
9a145a88ce Added capability to draw single or double lines.
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>
2010-04-06 10:30:58 +04:00
Andrew Borodin
cc2f5670ec Created new function: tty_draw_double_box().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-04-06 10:30:58 +04:00
Andrew Borodin
be3b0119da Fixed tty_print_alt_char() function for NCurses.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-04-06 10:30:58 +04:00
Sergei E. Ovsyannikov
d8fb069e85 Ticket #1648: implemented single-line boxes.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-04-06 10:30:58 +04:00
Andrew Borodin
58909eb708 Ticlet #1909: fix of extfs_read_archive() function.
Fixed bug introduced in ad9c1daad8 commit:
incorrect handling of "." and ".." directories within atchives.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-04-03 11:10:29 +04:00
Andrew Borodin
5b68413e62 Applied MC indentation policy.
Applied MC indentation policy to all files modified in this branch
with some simple manual modifications.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-03-30 16:21:22 +04:00
Vit Rosin
07a7f446b0 Ticket #2108: Fixed memory leak in fish_linear_start() function.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-03-30 16:21:22 +04:00
Slava Zanko
2dc590fe62 lib/util.c: Fixed memleak in load_mc_home_file() function
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-03-30 16:21:22 +04:00
Andrew Borodin
e94c1393e6 Fixed memory leak in mc_search__cond_struct_new_regex_accum_append().
Minor optimization.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-03-30 16:21:22 +04:00
Andrew Borodin
3c88948c9d Fixed memory leak in mc_closedir().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-03-30 16:21:21 +04:00
Andrew Borodin
f547d149ba Fixed memory leak in vfs_free_handle().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-03-30 16:21:21 +04:00
Andrew Borodin
407d1f38f5 Fixed memory leak in vfs_s_getlocalcopy().
Thanks Vit Rosin for the original patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-03-30 16:21:21 +04:00
Vit Rosin
c6a5837f6d Ticket #2069: fixed memory leaks.
Fixed memory leak in mc_config_read_file().

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-03-30 16:21:21 +04:00
Andrew Borodin
68d7a77210 Fixed of GSList item deallocation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-03-05 17:29:28 +03:00
Andrew Borodin
34d74f09b1 Ticket #1909: don't interpret trailing '+' as a plugin name.
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>
2010-03-05 17:29:28 +03:00
Slava Zanko
7206d2cc6c Fixed wrong colors
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-02-26 14:22:31 +02:00
Slava Zanko
5354d59337 Identation of some source files.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-02-26 11:26:00 +02:00
Slava Zanko
cd8b350b6d UNDELFS: code cleanup
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-02-26 10:58:49 +02:00
Slava Zanko
bff2f7303b Cleanup: avoid warnings for mc-library on x86_64
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-02-26 10:58:49 +02:00
Slava Zanko
1b75ea27b6 Cleanup of code for master
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-02-26 10:58:49 +02:00
Andrew Borodin
2cf080d18f Ticket #2058: fixed memory leaks in _vfs_get_cwd() function.
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>
2010-02-24 21:44:07 +03:00