Commit Graph

4871 Commits

Author SHA1 Message Date
Andrew Borodin
6cbb11673c src/vfs/undelfs/undelfs.c: fix memory leaks.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-11-25 13:47:39 +04:00
Slava Zanko
bd69b8dd31 Suppress cppcheck errors
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-11-25 13:47:39 +04:00
Andrew Borodin
ef90859a8f Ticket #3096: clarify "Setup saved to ~/.config/mc/ini" message.
The "Options -> Save setup" menu entry tells me "Setup saved to
~/.config/mc/ini".

This information is misleading, since this is not the only file
written, e.g. panels.ini is also updated.

Now this message contains the directory only:
"Setup saved to ~/.config/mc".

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-11-23 14:57:50 +04:00
Andrew Borodin
bae94b7acd Ticket #3105: fix crash when moving directories on different file systems
...in case "Verbose operation" option is off.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-11-22 14:20:42 +04:00
Slava Zanko
0bc183c842 Ticket #3101: F3 doesn't work on .so files in FreeBSD 9.x
FreeBSD 9.x doesn't accept syntax for viewing lib) files
processed by /usr/local/libexec/mc/ext.d/misc.sh
revealing "/usr/local/libexec/mc/ext.d/misc.sh: 25: Syntax error: | unexpected".

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-11-22 13:15:53 +03:00
Andrew Borodin
5a04c1ede2 Indentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:27:24 +04:00
Oleksandr Natalenko
97d7bdfd77 Ticket #3091: iso9660: fix truncated filenames.
±1 problem results in truncating filenames in ISO file listing. This
commit fixes the issue.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:09 +04:00
Andrew Borodin
50734c0716 Ticket #3089: (load_panelize): drop deprecated "find -perm +xxx" syntax.
Use "find -perm /xxx" instead.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:09 +04:00
Andrew Borodin
c26c3cc4fd (check_file_access): return FALSE if Esc was pressed.
edit_query_dialog2() returns (-1) in this case.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:09 +04:00
Andrew Borodin
c058e92586 Remove input_set_origin(). Use widget_set_size() instead.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:08 +04:00
Andrew Borodin
e78b1fdf66 Remove redundant checks for g_strdup().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:08 +04:00
Andrew Borodin
20ab79ba00 Use vfs_translate_path() to avoid extra string duplication.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:08 +04:00
Andrew Borodin
ae824a3622 src/vfs/extfs/helpers/urar.in: add comment.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:08 +04:00
Andrew Borodin
e4747a8c5d (extfs_get_path_int): fix memory leak.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:08 +04:00
Andrew Borodin
0fb3e0a3c7 Directory size: rename variables for consistency.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:08 +04:00
Andrew Borodin
01d6801f4e (do_compute_dir_count): display directory name only.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:08 +04:00
Andrew Borodin
5d1d542da9 (edit_ok_to_exit): get rid of file name string duplication.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:07 +04:00
Andrew Borodin
1b041ad484 (add2panelize_cmd): minor optimization and type accuracy.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:07 +04:00
Andrew Borodin
5e81b4be89 (do_panelize_cd): minor optimization.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:14:07 +04:00
Andrew Borodin
9ea1ed08c6 mcedit: file loading speed up.
Apply direct line counting during file reading.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:11:05 +04:00
Andrew Borodin
13c8f5213b (load_panelize): replace while() by for() and fix potential memory leak.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:11:05 +04:00
Andrew Borodin
9232bcb093 (edit_load_macro_cmd): minor refactoring: replace while() by for().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:11:04 +04:00
Marco Atzeri
87a5f11452 Ticket #3053: src/filemanager/filegui.c: fix preprocessor condition.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-04 09:11:04 +04:00
Andrew Borodin
33896c610b Ticket #1588: rpm extfs enhancements:
* Improve support for EPOCH
  * Add support for PREINPROG/POSTINPROG/PREUNPROG/POSTUNPROG
  * Add support for VERIFYSCRIPTPROG
  * Add support for TRIGGERSCRIPTS/TRIGGERSCRIPTPROG

Thanks Arkadiusz Miśkiewicz <arekm@maven.pl> for the original patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-03 12:43:00 +04:00
Slava Zanko
836cff5863 Fix indentation
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-10-03 10:57:03 +03:00
Egmont Koblinger
930f683019 Handle newline and tab with shift/ctrl modifiers correctly.
MC already has its own half-ready trick: when pasting with Shift-Insert,
using the X11 extension, the newline ("Enter" as mc calls it) with the
Shift modifier pressed gets converted to a "Return", and in the editor
the Return character inserts a non-indenting newline. This makes pasting
better in terminals not supporting bracketed paste, however, it has some
problems that this commit addresses:

  * Shift+newline gets this special treatment, but Ctrl+newline gets
    dropped. Hence e.g. when pasting in Gnome-terminal with Ctrl+Shift+V
    all the newlines will be missing. This commit adds the same
    non-indenting newline behavior to Ctrl+Newline and Ctrl+Shift+Newline.

  * The code forgets about Tab that also needs special treatment:

    - Most terminals send \e[Z on Shift+Tab, this is not handled by MC
      at all, moreover it causes a hang for about a second. This commit
      teaches this sequence to MC. This is especially useful when no X11
      is available, because there Ctrl+Tab is identical to Tab, so the
      backwards tab feature is not available. With this commit Shift+Tab
      becomes a backwards tab too on all terminals that emit \e[Z.

    - When pasting to the editor, Shift+Tab, Ctrl+Tab and Ctrl+Shift+Tab
      should all insert a tab for the same reason mentioned at the newline.

    - It would look inconsistent in the keymap files to have logical code
      such as "backtab" instead of "shift-tab" and friends, hence get rid
      of KEY_BTAB and use KEY_M_SHIFT | '\t' instead.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-03 11:41:58 +04:00
Egmont Koblinger
5b47861101 Support bracketed paste mode of xterm in mcedit.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-03 11:41:58 +04:00
Egmont Koblinger
8f35c90b94 Ticket #2661: support enable bracketed paste of xterm.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-10-03 11:41:58 +04:00
Oleksandr Natalenko
c4a546ac01 Ticket #3073: urar helper: fix handling filenames with spaces for unrar v5.
Extfs urar helper doesn't allow to see the whole filename if it
contains spaces and is unpacked by unrar v5. This commit should fix that.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-24 11:46:00 +04:00
Andrew Borodin
1988ce2759 Ticket #3070: changes to files in nested .zip archives are lost.
How to reproduce:

Changes to the text file inside nested .zip file are lost.

echo "hello, world" >hello.txt
zip message.zip hello.txt
zip wrapper.zip message.zip
rm -v hello.txt message.zip

Using mc enter to wrapper.zip/message.zip and edit (F4) "hello.txt",
save, then exit mc.

unzip wrapper.zip
unzip message.zip

Result: changes were not saved to "hello.txt".
Expected result: changes are saved.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-23 10:43:13 +04:00
Slava Zanko
0b0f7e3975 Refactoring: use define DEFAULT_CHARSET for "ASCII" charset.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-09-21 13:35:59 +04:00
Andrew Borodin
941a1eac1d Search: better support of --disable-charset
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-21 13:35:56 +04:00
Andrew Borodin
66da276200 Ticket 3069: fix of case-sensitive search
...if file encoding and locale are different.

Example: locale is KOI8-R, file encoding is UTF-8. Note: those encodings
are not same.

File content is following (in Russian):

йцукен
Йцукен

The difference is in first line char only: Й (lowercase letter) and й
(uppercase letter).  The search of Ê gives the result Й independently of
case sensitivity. й isn't found.
If switch "All charsets" on, nothing is found.

The main idea of fix is modification of search API to allow set of search
pattern charset and use if within search engine.
Old API:
mc_search_new (pattern, pattern_len);
New API:
mc_search_new (pattern, pattern_len, pattern_charset);

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-21 13:35:31 +04:00
Slava Zanko
8a28d3bac4 Rename type file_entry to the file_entry_t.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-09-19 16:22:30 +04:00
Slava Zanko
ba0808aae4 Concretize an usage of file_entry type.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2013-09-19 16:22:30 +04:00
Andrew Borodin
92cdd89887 Rename functions:
set_zero_dir -> dir_list_init
clean_dir -> dir_list_clean
do_sort -> dir_list_sort
do_load_dir -> dir_list_load
do_reload_dir -> dir_list_reload
get_dotdot_dir_stat -> dir_get_dotdot_stat

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-19 16:22:30 +04:00
Andrew Borodin
3470695357 Rename macros related to dir_list::size.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-19 16:22:30 +04:00
Andrew Borodin
6b31f67f31 (dir_list_append): add new dir_list API and use it.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-19 16:22:30 +04:00
Andrew Borodin
6aa9503f2f (clean_dir): try minimize memory usage.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-19 16:22:30 +04:00
Andrew Borodin
30cc6c6a29 Add dir_list::len member to keep number of items in list.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-19 16:22:30 +04:00
Andrew Borodin
a774019250 (handle_path): don't check list size here.
(handle_dirent): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-19 16:22:30 +04:00
Andrew Borodin
6a3943fcf0 (dir_list_grow): new public API of dir_list.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-19 16:22:30 +04:00
Andrew Borodin
e6bb69a0d9 Rename panel_sort_info_t to dir_sort_options_t
...and use it in routines of load and sort directory.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-19 16:22:30 +04:00
Andrew Borodin
72ad268a9c Move sort_field member out from panel_sort_info_t structure.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-19 16:22:30 +04:00
Andrew Borodin
d8d1f90082 Ticket #3066: refactoring of dir_list class and related code.
Initial commit: use GCompareFunc instead of sortfn.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-19 16:22:30 +04:00
Andrew Borodin
54a5139eec Ticket #2075: apply "Compute totals" option to Move operation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-19 15:05:48 +04:00
Denis Silakov
53dce22933 Support tar payload of rpm.
mc always expects to see cpio payload inside rpm packages. However, it
is also possible for rpm packages to contain tar payload (ustar, to be
more precise).

rpm2cpio works correctly for such files (but it produces tar archives,
not cpio ones).

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-14 10:24:53 +04:00
Andrew Borodin
20f8f204c8 Ticket #3064: crash in case of incorrect cpio content within rpm.
(cpio_open_archive): handle error of cpio header reading.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-14 10:24:29 +04:00
Andrew Borodin
446748619b Ticket #3047: fix mc arguments handling.
Following cases from command line are possible:
  * 'mc' (no arguments):
     active panel uses current directory
     passive panel uses "other_dir" from panels.ini
  * 'mc dir1 dir2' (two arguments):
     active panel uses dir1
     right panel uses dir2
  * 'mc dir1' (single argument):
     active panel uses dir1
     passive panel uses "other_dir" from panels.ini

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-13 18:00:50 +04:00
Andrew Borodin
4b8e47da6d Ticket #2271: fix i18n in Confirmation dialog.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2013-09-12 18:19:02 +04:00