* (file_op_context_new): change default value of file_op_context_t::do_reget.
* (overwrite_query_dialog): show the "Reget" button in query dialog for
move operation.
* (copy_file_file): keep non-default value of file_op_context_t::do_reget
that was set before.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Definitions are provided for:
- Various punctuation (divided into 9 groups);
- Preprocessor;
- Keywords;
- Data types;
- Data type qualifiers;
- Numbers (can be different for the integer, hexadecimal, octal and floatpoint representations);
- Strings and escaped characters;
- Comments (with keywords like "TODO:");
- Labels.
In total 32 "defines"...
Based on the original "c.syntax" file, this version includes most of the content from C89..C23.
ClosesMidnightCommander/mc#203.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
(edit_callback): use bracketed_pasting_in_progress variable to detect
if text is being pasted. If yes, paste text as is without macro
expanaison.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
* (tar_read_header): canonicalize path name after decoding of all
headers occupied with long file/directory name.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
* (extfs_open_and_read_archive): fix NULL dereference if
extfs_open_archive() doesn't create an error.
* (extfs_open_archive): create an error message when mc_open() returns -1.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
We currently call Bash with argv[0] being just the fixed string
"bash", but this confuses Bash when it initializes the shell variable
BASH, which are expected to be the absolute file path to the current
Bash image. This patch fixes argv[0] to be the actual path that mc
uses to start Bash.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This function is present at least in glib-2.43.92:
../../lib/glibcompat.c:69:1: error: static declaration of 'g_direct_equal' follows non-static declaration
69 | g_direct_equal (gconstpointer v1, gconstpointer v2)
| ^~~~~~~~~~~~~~
In file included from /home/zaytsev/opt/glib/include/glib-2.0/glib.h:50,
from ../../lib/global.h:10,
from ../../lib/glibcompat.c:36:
/home/zaytsev/opt/glib/include/glib-2.0/glib/ghash.h:180:10: note: previous declaration of 'g_direct_equal' was here
180 | gboolean g_direct_equal (gconstpointer v1,
| ^~~~~~~~~~~~~~
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
../../../src/filemanager/filegui.c:1413:35: warning: implicit conversion from 'int' to 'mode_t' (aka 'unsigned short') changes value from 262143 to 65535 [-Wconstant-conversion]
ctx->umask_kill = 0777777;
~ ^~~~~~~
../../../src/filemanager/fileopctx.c:81:23: warning: implicit conversion from 'int' to 'mode_t' (aka 'unsigned short') changes value from 262143 to 65535 [-Wconstant-conversion]
ctx->umask_kill = 0777777;
~ ^~~~~~~
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
../../../../src/vfs/sftpfs/connection.c:787:22: warning: passing 'unsigned char *const' to parameter of type 'const char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
if (strncmp (prompts[i].text, "Password: ", prompts[i].length) == 0)
^~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/string.h:84:26: note: passing argument to parameter '__s1' here
int strncmp(const char *__s1, const char *__s2, size_t __n);
^
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
../../../src/filemanager/file.c:2402:61: warning: variable 'attrs' may be uninitialized when used here [-Wconditional-uninitialized]
while (attrs_ok && mc_fsetflags (dst_vpath, attrs) != 0 && !ctx->skip_all)
^~~~~
../../../src/filemanager/file.c:2266:24: note: initialize the variable 'attrs' to silence this warning
unsigned long attrs;
^
= 0
../../../src/filemanager/file.c:3227:38: warning: variable 'attrs' may be uninitialized when used here [-Wconditional-uninitialized]
mc_fsetflags (dst_vpath, attrs);
^~~~~
../../../src/filemanager/file.c:2942:24: note: initialize the variable 'attrs' to silence this warning
unsigned long attrs;
^
= 0
../../../lib/strutil/tokenize.c:163:44: warning: variable 'delimopen' may be uninitialized when used here [-Wconditional-uninitialized]
if (nestdelim != 0 && string[i] == delimopen)
^~~~~~~~~
../../../lib/strutil/tokenize.c:72:19: note: initialize the variable 'delimopen' to silence this warning
char delimopen;
^
= '\0'
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Path to libssh2 headers was missing from CPPFLAGS resulting into FTBFS.
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Seemingly that at some point clang started accepting _any_ flags,
whereas previously it would error out.
These days, you can give it -Whamsandwich and it will succeed, while
at the same time throwing an annoying warning.
Add -Werror so that everything gets flagged and set accordingly.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108082
Cc: Vinson Lee <vlee@freedesktop.org>
Repored-by: Vinson Lee <vlee@freedesktop.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Get rid of double conversion of path: remove passwords using
vfs_path_from_str_flags (path, VPF_STRIP_PASSWORD).
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
* (add_to_list_take): new function: listbox_add_item_take() wrapper.
* (insert_file): use add_to_list_take().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Properly parse %h hostname token, which is widely used in HostName directive within
~/.ssh/config:
Host testing*
HostName %h.eu.example.com
Host staging*
HostName %h.us.example.net
# this host will be expanded to `testing-1.eu.example.com`
% mc sftp://username@testing-1
ClosesMidnightCommander/mc#197.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
* (vfs_canon): treate "#enc:" as a regular part of path in case of
--disable-charset.
* (realpath_test): likewise.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Handle potential NULL argument.
Clarify detection of absolute path: handle a case when path starts
with #enc:.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
* (vfs_dirent_assign): set d_len up.
* (mc_readdir): sync with new vfs_dirent: use d_len member.
* (filename_completion_function): likewise.
* (handle_dirent): likewise.
* (find_ignore_dir_search): add 2nd argument to use length of
directory name if it's known.
* (do_search): sync with modified vfs_dirent and find_ignore_dir_search().
* (NLENGTH): remove.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>