Sync with GNU tar b8feb2b14247d76200fd53607d3613c82b6e5b81.
Access header->buffer + offsetof (struct posix_header, magic), instead
of header->header.magic, when reading or writing the OLDGNU_MAGIC
pattern. The code violates the C standard without this change, and GCC
warns about this if fortify checking is enabled. It's not a bug on
traditional (i.e., non-debugging) platforms, but it does violate the C
standard so it should be fixed. Problem originally reported by John
Emil Karlson in
<http://lists.gnu.org/archive/html/bug-tar/2010-04/msg00023.html>.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Sync with GNU tar 33b63ebe94b8a2dc2cb8fb907d8b7c16591b05bc.
(struct extra_header): Removed unused structure.
(union block.extra_header): Removed unused member.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Include <fcntl.h> for the declaration of posix_fallocate. This
avoids an implicit function declaration and build issues with future
compilers.
Signed-off-by: Florian Weimer <fweimer@redhat.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
When using zsh with starship.rs prompt generator, MC sometimes fails
to show the subshell prompt. This is not deterministic. Sometimes the
prompt is shown and sometimes it isn't.
The reason is that the shell prints the prompt in multiple chunks. The
first chunk contains the "real" prompt and the second is an escape
sequence for enabling bracketed paste mode. If both chunks are read by
MC in a single invocation of read_subshell_prompt(), the prompt is
shown correctly. If, however, read_subshell_prompt() reads each chunk
in separate invocations (because the second chunk is not ready during
the first invocation), the prompt is not shown. More precisely, only
the bracketed paste mode escape sequence is shown as a prompt in MC.
This can be demonstrated with the following commands:
export SHELL=$(which zsh)
export ZDOTDIR=/tmp/zshdotdir
export STARSHIP_CONFIG=/tmp/starship-test.toml
mkdir -p "$ZDOTDIR"
echo 'eval "$(starship init zsh)"' > "$ZDOTDIR/.zshrc"
echo 'format = "XXXX: $directory$character"' > "$STARSHIP_CONFIG"
mc
In my case, the prompt is usualy shown after mc start and it
disappears after changing a directory in mc. In that case, the prompt
is read() in the following two chunks:
- 63 bytes: \xd\x1b[0m\x1b[27m\x1b[24m\x1b[J\xd\xaXXXX: \x1b[1;36mmc/.git\x1b[0m \x1b[1;32m\xe2\x9d\xaf\x1b[0m \x1b[K
- 8 bytes: \x1b[?2004h
To fix the problem, we remove clearing of the prompt string in
read_subshell_prompt(). It is sufficient that the prompt is cleared
when receiving '\n' and in feed_subshell().
Signed-off-by: Michal Sojka <michal.sojka@cvut.cz>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
If start directory of find files matches to the relative ignore
directory, nothing is found.
(do_search): the start directory is the first one in the directory
stack. Do not apply ignore_dir to it.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
The default margin is 72 characters, but the editor would keep 73 character
long lines without breaking them.
The visual length of strings was calculated incorrectly. The way "for" loop
was implemented, the byte length would be incremented before exiting the
loop. That would correspond to a character that doesn't fit the line.
Increment the byte length in a separate statement.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Previously, both file panels share panelization results.
Now each file panel has own panelization buffer.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Set "errdhotfocus" to a higher contrast color combination. Yellow is barely
visible on lightgray. The cursor stands on the the focused hotkey. If the
cursor is an underscore, the high contrast is obviously needed. If the focus
is a full box, it normally inverts both the background and the foreground, so
poor contrast remains poor. Red on lightgray is consistent with other colors
of the skin.
Set "menutitle" to yellow on blue. Otherwise, the title is not
distinguishable from the menu entries. Both "parent" skins, default and
xoria256, use distinctive color for the popup menu title.
Set "editrightmargin" to the same color as the panels. White on blue is
extremely distracting in contrast to black background to the left of the
margin.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Set "disabled" background to "lightgray" for consistency with the dialog
background. The inconsistent background can be seen in the file search dialog
with an empty search string.
The hotkeys in dialogs were impossible to distinguish from other text. Make
them red for consistency with the buttonbar.
Show changed lines in diffs in black on cyan. Blue on cyan is hard to see,
such color combination is not used elsewhere in the skin, which promises
"good contrast".
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
* 4426_cleanup: (49 commits)
ru/mc.1: fix typo.
doc/NEWS: indentation.
Update po/*.po files.
Ticket #4437: (file_frmt_time): fix time format.
mcedit: use diff syntax highlighting for git commit messages
(load_extension_file): make one-line long error messages multi-line.
mc.ext.ini.in: fix a typo (closesMidnightCommander/mc#178).
Filehighlight: recognize vsix files as zip files (closesMidnightCommander/mc#171).
mcedit: support modern ECMAScript syntax in TypeScript (closesMidnightCommander/mc#172).
Aadd syntax highlighting for modern ECMAScript (closesMidnightCommander/mc#172).
extfs helpers: replace "perl -w" with "use warnings" (closesMidnightCommander/mc#174).
(do_find): use dir_list_append() to create file list for panelization.
(do_find): remove unused variable.
Fix various typos in the source code (closesMidnightCommander/mc#177).
(panel_destroy): don't free file list.
(search_content): use g_get_monotonic_time() instead of g_get_real_time().
(extfs_get_plugins): minor optimization.
(edit_read_syntax_rules): trivial refactoring.
mcedit (syntax): minor optimization.
src/filemanager/panelize.c: use GSList to hold panelize entries.
...
vsix files are vscode code plugins and they just zip archives, so
it makes sense to recognize them as alternative zip file extension.
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
Signed-off-by: Yury V. Zaytsev <yury.zaytsev@moneymeets.com>
The shebang's max length is usually 128 as defined in
/usr/include/linux/binfmts.h:
#define BINPRM_BUF_SIZE 128
To get around this, '/usr/bin/env perl' in place of @PERL@ can be used, but
'/usr/bin/env perl -w' doesn't work:
/usr/bin/env: perl -w: No such file or directory
So replace "perl -w" with "use warnings" to make it work.
The man2hlp.in already has "use warnings;", so just removing '-w' is OK.
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
Found via `codespell -S
po,doc,./misc/syntax,./src/vfs/extfs/helpers/README.it -L
parm,rouge,sav,ect,vie,te,dum,clen,wee,dynamc,childs,ths,fo,nin,unx,nd,iif,iterm,ser,makrs,wil`
Co-authored-by: Yury V. Zaytsev <yury@shurup.com>
Signed-off-by: Kian-Meng Ang <kianmeng@cpan.org>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
Use GString for syntax keywords to calculate keyword length at once
when syntax file is being parsed.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>