As we pass correctly(hopefully) escaped file names - all calls
(except forgotten chgrp) were converted to accept unquoted strings.
This patch fixes chgrp.
Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
Comment snippet:
We can't just allocate struct dirent as (see man dirent.h)
struct dirent has VERY nonnaive semantics of allocating
d_name in it. Moreover, linux's glibc-2.9 allocates dirents _less_,
than 'sizeof (struct dirent)' making full bitwise (sizeof dirent) copy
heap corrupter. So, allocate longliving dirent with at least
(NAME_MAX + 1) for d_name in it.
Strictly saying resulting dirent is unusable as we don't adjust internal
structures, holding dirent size. But we don't use it in libc infrastructure.
TODO: to make simpler homemade dirent-alike structure.
Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
Modified descriptions.
src/strutil.c (_str_convert): return value of estr_t type instead of int.
Check coder first. Removed redundant code.
(str_convert): simplified. Changed returned type to estr_t.
(str_nconvet): likewise.
(str_vfs_convert_to): likewise.
(str_vfs_convert_from): likewise. Used symbolic names instead of hardcoded values.
(str_translate_char): likewise.
src/strutil8bit.c (str_8bit_vfs_convert_to): likewise. Made function static.
src/strutilascii.c (str_ascii_vfs_convert_to): likewise.
src/strutilutf8.c: (str_utf8_vfs_convert_to): Used symbolic names
instead of hardcoded values.
src/charsets.c (convert_from_utf_to_current): likewise.
(convert_from_utf_to_current_c): likewise.
(convert_from_8bit_to_utf_c): likewise.
(convert_from_8bit_to_utf_c2): likewise.
src/view.c (view_get_char): likewise.
vfs/vfs.c (_vfs_translate_path): Changed returned type to estr_t.
Used symbolic names instead of hardcoded values.
(vfs_translate_path): likewise.
* mc-4.6:
backport: lt.po: update by stikonas (#274)
backport: nl.po: update by mpol (#271)
fixed mismerge: completion stuff
mismerge fix: g_concat -> g_strconcat
header guard fix
Remove some of the SHELL_ESCAPE_STR Stuff...
Revert "introduced new type SHELL_ESCAPED_STR for more type safety"
Last bunch of reverts and removal of mhl/*
fixed canonicalize_pathname() breakage: fixed str_move() function (memmove semantics) again
Revert some functions (mhl_mem_free to g_free, etc)
Revert "replaced buggy concat_dir_and_file() by mhl_str_dir_plus_file()"
Revert "mhl: mhl_shell_unescape_buf(): fixed memory array OOB."
Revert "build fix: added missing declaration of mhl_dir_plus_file (reported by andrew_b)"
Revert "cleanup: mhl_str_dir_plus_file(): int -> size_t (suggested by Andrew Borodin)"
Revert "fixed #240"
Revert "Fixing a theoretical buffer overflow which was reported by Roland Illig"
Revert "Call va_end after the iteration as we need to free the list again."
Revert "Added enhancements from Sergei which he attached to #241."
Revert "Resolve some issues in mhl Rollang Illig pointed us to:"
Conflicts:
ChangeLog
edit/edit.c
edit/editcmd.c
edit/editwidget.c
edit/syntax.c
src/command.c
src/complete.c
src/ext.c
src/find.c
src/screen.c
src/util.c
src/widget.c
vfs/extfs.c
vfs/fish.c
This commit moves the mhl_str_concat_dir_and_file back into src/util.c whitout changing atm the functionality.
Please note that this is an incomplete fix and needs to be partially enhanced in order to keep the full functionality with glib.
Signed-off-by: Patrick Winnertz <winnie@debian.org>
This removes the usage of stdbool.h in favour of mhl/tyes.h as we have to revert everything one by one
Signed-off-by: Patrick Winnertz <winnie@debian.org>
./configure --enable-samba && make
../vfs/libvfs-mc.a(smbfs.o): In function `smbfs_get_path':
/home/andrew/work.c/mc/mc.master/vfs/smbfs.c:1214: undefined reference to `mhl_str_dir_plus_file'
collect2: ld returned 1 exit status
Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
* mc-4.6: (38 commits)
mhl: mhl_shell_unescape_buf(): fixed memory array OOB.
completion: fixed complete already escaped secuences.
completion: added changelog entry for solved #147
completion: fixed completion of escaped commands in commandline
Removed unused char*.
mhl: added mhl_strmove() function (memmove semantics)
completion: added escapes in command line on completion
complete: cleanup: #define to enum INPUT_COMPLETION_FLAGS
added a new parameter for completion flags to input_new
fish: cleanup: unboxed quoted strings when generate shell commands
introduced new type SHELL_ESCAPED_STR for more type safety
added mhl/types.h which defines bool enum, escape.h now using this type
Removed unused variable
Changes for use MHL.
Fixed bug with renamig/copying files with backshashes in names
Remove some testing stuff
Temporarry commit. Fixed completion in browse by directoryes.
Fixed some memory leaks.
Add $ and ` for escaping and reorder it according to the ascii values
Rewrite it to use g_string_append_c instead of some homebrew stuff
...
* mc-4.6:
replaced buggy concat_dir_and_file() by mhl_str_dir_plus_file()
fixed out-of-tree-builds
Updated the NEWS file for 4.6.2 and added the bugnumbers behind the items in the list.
Update for OpenOffice and StarOffice viewer.
changelog: added entry for python syntax
syntax: python: keywords update (patch by NNemec) fixes#216
AC_USE_SYSTEM_EXTENSIONS macro requires autoconf >= 2.60
po/ru.po: In russian translation, there are some hotkey conficts in menu.
ChangeLog/NEWS: added entry for #181 ticket (copy to deleted dir)
Now a trailing slash will only be added in copy & move dialogs if the path itselfs
copy/move dialog: add trailing '/' to default destination path (fix#181)
fixed comments to /* ... */
Not only comment it out but removing it
Removed unneeded var to make build process a bit cleaner
Add code snipplet by il.smind which should fix issues with putty and
Conflicts:
ChangeLog
mhl/string.h
src/command.c
src/complete.c
src/file.c
src/util.c
vfs/ChangeLog:
* fish.c: Iterpret SUP.flags as port number if SUP.flags is not in
* 0, FISH_FLAG_COMPRESSED and FISH_FLAG_RSH. Weakness: port number
Originally by Andrew V. Samoilov <sav>
Signed-off-by: Mikhail S. Pobolovets <styx.mp@gmail.com>
add support for filesystem, that use others encodings than mc (vfs). Now can be
encoding set only manually, but automatic detection is possible. Filename is
converted in mc_readdir and other function translate it back by vfs_translate
added menu etries encodnig in left and rigth menu (localization will be neede)
modified subshell.c to put subshell correct working directoy,
modified ext.c and execute.c to translate filename before running command
there could be one problem, vfs_translate_path does not use something like
path_magic function
Changes:
* removed "" from all operations, because shells do not like it:
$ LANG=C ls "//\ a\ -\>\ b\ \"\"\""
ls: cannot access //\ a\ -\>\ b\ """: No such file or directory
$ [sf] ~:LANG=C ls //\ a\ -\>\ b\ \"\"\"
// a -> b """
* transited to mhl escaping function in vfs/fish.c
* fixed vast majority of FISH ops in respect to special chars
Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
!!!WARNING!!!: FISH is still broken
Changes
* fixed sed fallback (added escaping)
* fixed FISH hangup (introduced earlier in perl changes)
* added FISH 500 if perl script dies somehow (no more FISH hangups on dir list path!)
* added '#if 0' in vfs/fish.c:fish_dir_load() - handy to debug
Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
- check if remote have a 'test' utility.
If 'test' exists - use it for recognize symlinks (test -L)
and forming "L<symlink>" string in output
- Restore part of source code for handling "L<symlink>"
- check if 'ls' command support option '-Q' and use it if supported
- FIXME: need to write fish_get_unquoted_filename
- FIXME: need to rewrite algorithm of parsing ' -> ' substring
(relative to -Q option)
New logic will correct show symlinks on lot of OSes, but in some
pure OSes need to review...