Commit Graph

14238 Commits

Author SHA1 Message Date
Andrew Borodin
b11c84dbb7 Document the %f macro related to mcedit. 2017-10-28 18:46:14 +03:00
Andrew Borodin
f89fff139c Fix %f macto in mcedit user menu.
In mcedit user menu the %f macro should match the file name opened in
mcedit not the file name is selected in the panel.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-10-28 18:46:14 +03:00
Andrew Borodin
680678ef72 Ticket #3861: fix %f macro in mcedit user menu.
Initial step: move usermenu.[ch] files from src/filemanager/ directory
to src/ one.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-10-28 18:46:08 +03:00
Andrew Borodin
b47f233a80 Merge branch '3855_mcview_seach_ask_continue_from_begin'
* 3855_mcview_seach_ask_continue_from_begin:
  Ticket #3855: mcview: search doesn't ask about starting over
2017-10-08 10:10:42 +03:00
Andrew Borodin
1221900262 Ticket #3855: mcview: search doesn't ask about starting over
Broken in 178628e67f.

(mcview_do_search): do search in last chunk if data source is the
growing buffer only.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-09-26 12:56:05 +03:00
Yury V. Zaytsev
cb1be748d8 Merge branch '3852_broken_tcsh_escaping' 2017-09-09 17:30:43 +02:00
Yury V. Zaytsev
0fec3ef449 Ticket #3852: subshell - fix broken tcsh 6.20+ cd escaping
Reported-by: Anatoly Borodin <anatoly.borodin@gmail.com>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2017-09-09 11:16:46 +02:00
Yury V. Zaytsev
1a6f9e0239 Merge branch '3843_8bit_to_utf8_broken' 2017-09-09 11:01:39 +02:00
Yury V. Zaytsev
5ee452eba9 Ticket #3843: mcedit - fix broken encoding into UTF-8 for 8-bit displays
Reported-by: Lőrinczy Zsigmond <lzsiga@freemail.c3.hu>
Reviewed-by: Egmont Koblinger <egmont@gmail.com>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2017-09-09 08:48:21 +02:00
Andrew Borodin
5d142251e0 Merge branch '3846_mcview_hook'
* 3846_mcview_hook:
  Ticket #3846: fix crash on slow startup...
2017-08-07 13:44:41 +03:00
Andrew Borodin
443b92e16a Ticket #3846: fix crash on slow startup...
...because of access to free'd viewer in the idle hooks execution.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-08-07 13:44:22 +03:00
Izzy
1046f489f1 syntax: add missing SQL keywords (closes MidnightCommander/mc#129)
Signed-off-by: Yury V. Zaytsev <yury.zaytsev@moneymeets.com>
2017-07-30 21:20:00 +02:00
Izzy
f397f9b0de syntax: add missing PHP keywords (closes MidnightCommander/mc#129)
Signed-off-by: Yury V. Zaytsev <yury.zaytsev@moneymeets.com>
2017-07-30 21:18:17 +02:00
Andrew Borodin
37013e7db3 Merge branch '3616_utf8_normalize_speedup'
* 3616_utf8_normalize_speedup:
  Ticket #3616: speed up of utf-8 normalization.
2017-07-29 10:23:40 +03:00
devzero
7f9b333861 Ticket #3616: speed up of utf-8 normalization.
When content of a large directory is being sorted by file names, a
significant amount of CPU time is spent in str_utf8_normalize() that is
called from str_utf8_create_key_gen().

For example, /usr/bin/ contains 5437 files on my Archlinux box. Running
mc /usr/bin/ /usr/bin/ takes approx. 75 000 000 CPU instructions to sort
file names, or 25% of total program run time. From these 75 000 000
instructions, 42 500 000 instruction are spent in str_utf8_normalize().

str_utf8_normalize() uses g_utf8_normalize() to do the work.
g_utf8_normalize() is a heavyweight function, that converts UTF-8 into
UCS-4, does the normalization and then converts UCS-4 back into UTF-8.

Since file names are composed of ASCII characters in most cases, we can
speed up str_utf8_normalize() by checking if the heavyweight Unicode
normalization is actually needed. Normalization of ASCII string is
no-op, so it is effectively "normalized" by just strdup().

With this patch, running mc /usr/bin/ /usr/bin/ requires just 37 000 000
instructions to sort the file names (down from 75 000 000) and 4 500 000
instuctions to do str_utf8_normalize() (down from 42 500 000).

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-07-29 10:23:09 +03:00
Yury V. Zaytsev
eab2556ed8 Merge branch '3836_with_homedir_yes' 2017-07-15 22:53:28 +02:00
Yury V. Zaytsev
9932087cec Ticket #3836: maint - set default --with-homedir value to .mc instead of yes
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
Reviewed-by: Andrew Borodin <aborodin@vmail.ru>
2017-07-15 22:52:47 +02:00
Yury V. Zaytsev
213c729887 Merge branch '3840_menu_quoting' 2017-07-15 22:22:17 +02:00
Yuriy M. Kaminskiy
e081d55616 Ticket #3840: (de)compression from menu broken due to bad quoting
If the file is not compressed and DECOMP is empty, it should be replaced
by *nothing*, not an empty argument. Broken in the following commit:

  becc0d01d0

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2017-07-13 20:02:38 +02:00
Denis Briand
4a4f601a90 Ticket #3839: fix spelling errors in the man page
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2017-07-09 18:16:28 +02:00
Artem S. Tashkinov
75674446e4 Ticket #3834: add ac3, aac, dts and m4a media extensions
Closes MidnightCommander/mc#128:

  * https://en.wikipedia.org/wiki/Advanced_Audio_Coding
  * https://en.wikipedia.org/wiki/M4A (used extensively by Apple)
  * https://en.wikipedia.org/wiki/Dolby_AC3
  * https://en.wikipedia.org/wiki/DTS_(sound_system)

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2017-07-09 10:16:17 +02:00
Andrew Borodin
5e5f57cf2f Merge branch '3826_mcview_goto_fixes'
* 3826_mcview_goto_fixes:
  mcview: minor refactoring.
  mcviewer: fix goto offset.
  Ticket #3826: mcview: goto doesn't grow file as much as needed.
2017-06-28 08:31:17 +03:00
Andrew Borodin
d5b0417cb2 mcview: minor refactoring.
* (mcview_growbuf_read_all_data): new function.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-06-28 08:31:02 +03:00
Andrew Borodin
1453f41a58 mcviewer: fix goto offset.
* (mcview_dialog_goto): do read data from pipe in case of
MC_VIEW_GOTO_OFFSET_DEC and MC_VIEW_GOTO_OFFSET_HEX.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-06-28 08:31:02 +03:00
Andrew Borodin
cc95f6f654 Ticket #3826: mcview: goto doesn't grow file as much as needed.
Goto decimal/hexadecimal offset doesn't grow the file if necessary,
rather stops at an earlier offset.
Goto percent doesn't work either. It's trickier because no matter what
the percent value is, it'd need to read the entire contents.
Goto line number works as expected.

* (mcview_dialog_goto): read all data from pipe in case of
MC_VIEW_GOTO_PERCENT.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-06-28 08:31:02 +03:00
Andrew Borodin
b88e72e20f Merge branch '3829_syntax_case_insense'
* 3829_syntax_case_insense:
  Syntax.in: simplify some patterns.
  Ticket #3829: Syntax.in: simplify case insensitive patterns.
2017-06-21 10:32:39 +03:00
Andrew Borodin
f3187c8930 Syntax.in: simplify some patterns.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-06-21 10:31:32 +03:00
Andrew Borodin
c8b99bb083 Ticket #3829: Syntax.in: simplify case insensitive patterns.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-06-21 10:31:32 +03:00
Yury V. Zaytsev
bc961db632 Merge branch '3828_hive_syntax' 2017-06-16 13:48:22 +02:00
Mike L
f603cd3e16 Ticket #3828: syntax: Apache Hive query language
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2017-06-16 13:46:52 +02:00
Andrew Borodin
2e834a72f1 Merge branch '3819_mcview_search_grow'
* 3819_mcview_search_grow:
  Ticket #3819: mcview: search doesn't grow file as much as needed.
2017-05-27 19:14:11 +03:00
Andrew Borodin
178628e67f Ticket #3819: mcview: search doesn't grow file as much as needed.
(mcview_do_search):
  * In main search loop: don't break in case of MC_SEARCH_E_NOTFOUND
error. Make next iteration until buffer can be grown.
  * Make search in the last data chunk.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-05-27 19:13:47 +03:00
Yury V. Zaytsev
b088459e0e Merge branch '3821_init_st_mtim' 2017-05-17 21:19:10 +02:00
Yury V. Zaytsev
f0414be51d Zero struct stat tv_nsec (if supported) whenever st is filled manually
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2017-05-17 21:18:58 +02:00
Andrey Gursky
243cdc1755 Ticket #3821: initialize struct stat st_[acm]tim.tv_nsec when present
struct stat in libc for Linux kernel contains few fields more since 14+
years [1]. From bits/stat.h:

```
        struct timespec st_atim;		/* Time of last access.  */
        struct timespec st_mtim;		/* Time of last modification.  */
        struct timespec st_ctim;		/* Time of last status change.  */
    # define st_atime st_atim.tv_sec	/* Backward compatibility.  */
    # define st_mtime st_mtim.tv_sec
    # define st_ctime st_ctim.tv_sec
```

The conventional fields became an alias.

POSIX.1-2008 made struct stat st_[acm]tim mandatory [2].

OS takes care to initialize struct stat properly [3]. By not using an OS
syscall or a libc wrapper to fill struct stat, we have to take care of
initializing all fields (or at least those being used later) explicitly.

[1]: https://www.sourceware.org/ml/libc-alpha/2002-12/msg00011.html
[2]: https://www.sourceware.org/ml/libc-alpha/2009-11/msg00102.html
[3]: https://www.sourceware.org/ml/libc-alpha/2002-12/msg00013.html

Fixes: file timestamps not preserved (https://mail.gnome.org/archives/mc-devel/2017-April/msg00000.html)
Reported-By: Nerijus Baliunas <nerijus@users.sourceforge.net>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2017-05-17 21:18:58 +02:00
Andrew Borodin
71c8f5bedc Merge branch '3817_mcview_grow_buffer'
* 3817_mcview_grow_buffer:
  Ticket #3817: mcview: fix read of filtering data from pipe.
2017-05-17 13:23:05 +03:00
Egmont Koblinger
27c30e8f5f Ticket #3817: mcview: fix read of filtering data from pipe.
(mcview_eol): grow buffer every time when it really needed.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-05-17 13:22:53 +03:00
Andrew Borodin
ed0ed4ac72 Merge branch '3783_mcview_invalid_utf8'
* 3783_mcview_invalid_utf8:
  Ticket #3783: mcview: fix interpretation of invalid utf-8 symbols.
2017-05-17 11:28:53 +03:00
Egmont Koblinger
5e238fae95 Ticket #3783: mcview: fix interpretation of invalid utf-8 symbols.
(mcview_get_utf): report invalid utf-8 as negative integer.

The bug was introduced in 4d65a731c2.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-05-07 20:50:27 +03:00
Andrew Borodin
cea0973393 Merge branch '2297_incremental_tar_empty_dirs'
* 2297_incremental_tar_empty_dirs:
  Ticket #2297:  show empty directories in incremental tar archives.
2017-05-04 09:54:44 +03:00
Witold Filipczyk
49898835fd Ticket #2297: show empty directories in incremental tar archives.
How to reproduce:
1. Create two tar files with empty dir:
$ mkdir -p dir/dir1; mkdir dir/dir2; touch dir/dir1/file
$ tar cf normal.tar dir/
$ tar cf incremental.tar -g incremental.snap dir/
2. Press Enter to enter to normal.tar.
Result: normal.tar contains dir/dir2, incremental.tar doesn't.
Expected result: incremental.tar contains dir/dir2.

This patch also fixes Ticket #3709: Wrong directories owner for tar
--numeric-owner -g.

How to reproduce:
As root:
 # mkdir -p TEST/TEST2
 # echo aaa > TEST/TEST2/aaa.txt
 # chown 10000:10000 TEST
 # chown 10001:10001 TEST/TEST2
 # chown 10002:10002 TEST/TEST2/aaa.txt

 # tar --numeric-owner -zcf test1.tar.gz TEST
 # tar --numeric-owner -g test.inc -zcf test2.tar.gz TEST

and now view these tarballs with long view. Directories of test2.tar.gz
have owner root instead of 10000 or 10001, but if you untar them using
tar -xvf directories owners are correct

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-05-04 09:48:22 +03:00
Marco Ciampa
59b12cf2cb Updated Italian translation 2017-05-03 09:33:50 +02:00
Yury V. Zaytsev
22c52e5f6f Update translations from Transifex
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2017-05-02 21:29:41 +02:00
Mooffie
83127bd5ff Merge branch '3816_quickview_f10'
* 3816_quickview_f10:
  Ticket #3816: F10 doesn't work in QuickView.
2017-04-24 18:49:02 +03:00
Mooffie
7fba743d77 Ticket #3816: F10 doesn't work in QuickView.
Signed-off-by: Mooffie <mooffie@gmail.com>
2017-04-24 18:36:21 +03:00
Mooffie
9df3933a4a Merge branch '3815_quickview_return'
* 3815_quickview_return:
  TreeView should mute the command-line.
  QuickView shouldn't consume all keys.
  Factor out handle_cmdline_enter().
  Ticket #3815: Factor out is_cmdline_mute().
2017-04-24 18:35:07 +03:00
Mooffie
2edb0052fd TreeView should mute the command-line.
Because it's a recipe for disaster to mix, for example, DEL for deleting a
directory and BACKSPACE for deleting the previous char.

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-04-24 18:31:38 +03:00
Mooffie
e90eea874d QuickView shouldn't consume all keys.
The QuickView should return MSG_HANDLED, in its MSG_KEY, *only* for keys it has
indeed handled.

We move the "don't pass any chars to command line" responsibility to the main
dialog instead.

(We're reverting commit 8469c13f38 here.)

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-04-24 18:31:38 +03:00
Mooffie
16c9ec0108 Factor out handle_cmdline_enter().
Signed-off-by: Mooffie <mooffie@gmail.com>
2017-04-24 18:31:38 +03:00
Mooffie
12d6ead7fc Ticket #3815: Factor out is_cmdline_mute().
Signed-off-by: Mooffie <mooffie@gmail.com>
2017-04-24 18:31:25 +03:00