Sync with gnulib 64ddc975e72cb55d2b2d755c25603bd70312aa5e:
This patch alters xstrtoumax behavior slightly, in areas are not
likely to affect any real callers, by making xstrtoumax behave more
like the system strtol. In particular, it lets xstrtoumax support
bases other than those required by POSIX, if the underlying
implementation does; this removes the need for an g_assert().
* lib/strutil/strtol.c: Do not include stdio.h.
(xstrtoumax): Use same parameter names as POSIX, to make it
easier for outsiders to follow. Do not require the base to be 0-36,
as the underlying implementation is allowed to support other bases.
Sync with gnulib 16b33e6649425fcdce095f262da98b539d2f7448.
* (xstrtoumax): Don't update *endptr if strtol doesn't.
Also, if the underlying strtol gives an unusual error number and
sets *endpnr = nptr, assume that's an error not a missing number.
Sync with gnulib bd1e981434c98751b1106a1744e77a27317b52b3
* (xstrtoumax): Stop worrying about hypothetical implementations that
are causing more confusion than the code is worth. Instead, go back
more to old way of doing things. None of this matters for practical
applications.
Add commemt.
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/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>
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>
* (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>
Add new item to a listbox taking ownerhip of item text
and avoid a string duplication.
(listbox_add_item): reimplement using listbox_add_item_take().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Steps to reproduce:
1. Create file owth a space in the name:
touch "a b"
There should no other files with name begins with "a" in the directory.
2. Press Shift-F4 to open editor
3. Press Shift-F2 to display dialog window "Save as..."
4. Press Esc+Tab to fill an input line
Result:
a\ b will appear in the edit field.
If you attempt to save the file, the back slash will be in the filename.
Expected result:
no any extra back slashes in the file name.
Soution: escape only '?', '*', and '&' symbols as described in the
manual page (see a11995e12b).
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
* (mc_tmpdir): use g_mkdtemp() to create temporary directory.
Make it name unique to avoid conflicts with other software such as
Distrobox container.
* (main): temporary directory has unique name from now. Remove it at exit.