Commit Graph

14265 Commits

Author SHA1 Message Date
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
Andrew Borodin
ed1ed00073 Merge branch '3810_keep_panelization'
* 3810_keep_panelization:
  File panel: unification of terminology.
  Refactoring: handle panel listing mode switch in the panel level
  Refactoring: ret rid of set_basic_panel_listing_to().
  (listing_cmd): reset panel filter.
  Ticket #3810: keep panelization while switching panel listing mode.
2017-04-24 16:18:39 +03:00
Andrew Borodin
ff1510de1f File panel: unification of terminology.
Use 'list(ing) format' instead of 'list(ing) type' and 'list(ing) mode'.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-04-24 16:16:27 +03:00
Andrew Borodin
b56a77e02f Refactoring: handle panel listing mode switch in the panel level
...instead of top level.

Rename and move main/PanelListingSwitch keybind to panel/ListingSwitch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-04-24 16:16:27 +03:00
Andrew Borodin
9612df677a Refactoring: ret rid of set_basic_panel_listing_to().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-04-24 16:16:27 +03:00
Andrew Borodin
34aaab47ba (listing_cmd): reset panel filter.
When change panel mode to listing one, in addition to reset of
panelization, reset panel filter too.

Optimization: get rid of double panel reload.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-04-24 16:16:27 +03:00
Andrew Borodin
edb51c4457 Ticket #3810: keep panelization while switching panel listing mode.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-04-23 11:17:10 +03:00
Mooffie
e4983a18e8 Merge branch '3813_filter_clear'
* 3813_filter_clear:
  Ticket #3813: Filter isn't cleared when entering empty string.
2017-04-23 10:06:09 +03:00
Mooffie
24de5eb1df Ticket #3813: Filter isn't cleared when entering empty string.
Signed-off-by: Mooffie <mooffie@gmail.com>
2017-04-21 17:25:53 +03:00
Mooffie
e0cd82a101 Merge branch '2942_panelize_absolutize'
* 2942_panelize_absolutize:
  do_panelize_cd() is missing call to panelize_absolutize_if_needed().
  Introduce panelize_absolutize_if_needed(), plus documentation.
  Fix assumptions of "dir.list->len == 0".
  Ticket #2942: External panelize: opening a file with an absolute path fails.
2017-04-20 20:22:24 +03:00
Mooffie
d1062fc47c do_panelize_cd() is missing call to panelize_absolutize_if_needed().
Whenever we populate a panelized panel, we have to call
panelize_absolute_if_needed().

Note: do_panelize_cd() implements the "Restore last panelization" command
(see #3767).

Note: We move the `panel->is_panelized = TRUE` line to the bottom for stylistic
reason: to make it parallel to the other places where we have similar code. We
may factor out this common code in the future.

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-04-18 20:09:44 +03:00
Mooffie
92eea68251 Introduce panelize_absolutize_if_needed(), plus documentation.
Instead of imperfectly duplicating code we create a function.

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-04-18 20:09:44 +03:00
Mooffie
bb45f84071 Fix assumptions of "dir.list->len == 0".
`dir.list->len` can't be zero because we're always checking it after a call to
dir_list_init(), which populated the list with "..".

Therefore any code that checks for zero is either superfluous or a bug.

As for the modifications in find.c:

  - The bug caused us not to call panel_clean_dir(), and this caused:
    - Memory leaks resulting from calling dir_list_init() without
      dir_list_clean() first.
    - The "total size" of selected files (for example) wasn't getting cleared.

  - We remove the `if (list->len != 0)` around the
    `current_panel->is_panelized = TRUE; ...` for several reasons:
    - The code isn't called anyway if no files were found.
    - Conceptually, there's no point in distinguishing an empty listing from an
      empty panelized listing.
    - It's the de-facto current behavior (as `list->len != 0` always)

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-04-18 20:09:44 +03:00
Andreas Mohr
c9f058e65b Ticket #2942: External panelize: opening a file with an absolute path fails.
We fix the detection of absolute paths in the panel's list. `list[0]` is "..",
so we need to inspect `list[1]`.

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-04-18 20:09:34 +03:00
Andrew Borodin
161e3a1719 Merge branch '3805_help_message'
* 3805_help_message:
  Update po/mc.pot and po/*.po.
  Ticket #3805: fix --help option to show correct syntax for editor, viewer and mcdiff
2017-04-15 09:57:01 +03:00
Andrew Borodin
a0c6dd7bb6 Update po/mc.pot and po/*.po.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-04-15 09:56:44 +03:00
Denys Vlasenko
f0d3241ecb Ticket #3805: fix --help option to show correct syntax for editor, viewer and mcdiff
Before the patch: --help shows the same text for all tools, only "mc"
is replaced by tool name. For example, "mcedit --help" says:

        Usage:
          mcedit [OPTION...] [+number] [this_dir] [other_panel_dir]
         +number - Set initial line number for the internal editor

which is wrong: mcedit does not take [this_dir] [other_panel_dir]
syntax, that's mc syntax.

After the patch, each tool has its own syntax string shown.
"Usage:" message for each tool is as follows now:

  mc [OPTION...] [this_dir] [other_panel_dir]

  mcedit [OPTION...] [+lineno] file1[:lineno] [file2[:lineno]...]

  mcview [OPTION...] file

  mcdiff [OPTION...] file1 file2

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-04-15 09:49:29 +03:00
Andrew Borodin
f4eb2c47c9 Indentation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-04-14 18:54:22 +03:00
Andrew Borodin
e0d6617fd0 Merge branch '3697_ncurses_tty_init'
* 3697_ncurses_tty_init:
  Ticket #3697: (tty_init): unify curses initialization
2017-04-14 14:10:25 +03:00
Thomas Dickey
4d46a10862 Ticket #3697: (tty_init): unify curses initialization
...for various curses implementations.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-04-14 14:06:13 +03:00
Denys Vlasenko
4f4df7d323 Ticket #3806: man pages: fix paths of mc.hint and mc.hlp.
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-04-14 13:46:35 +03:00
David Martin
ff540868e8 doc: update Spanish help template
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2017-04-11 19:02:00 +02:00
Sergei Epiphanov
fd3d4e2784 Ticket #3804: syntax: update Ada 95 keywords (ALT Linux #33330)
Signed-off-by: Sergey Y. Afonin <asy@altlinux.org>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2017-04-04 19:29:46 +02:00
Yury V. Zaytsev
7e57d6e776 maint: add ts.syntax to build system / tarballs
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2017-03-19 10:51:27 +01:00