Commit Graph

171 Commits

Author SHA1 Message Date
Slava Zanko
f018970577 Renamed functions shell_escape (to strutils_shell_escape) and shell_unescape (to strutils_shell_unescape)
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-12 10:32:00 +03:00
Slava Zanko
5f810602e0 Moved 'escape' and 'unescape' strings functions from src/util.[ch] into src/strescape.[ch]
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-06-12 10:31:59 +03:00
Slava Zanko
1a899905bd Fix usage of shell_[un]escape functions.
These functions returns newly allocated string, but calling don't freeze correctly allocated memory.
2009-05-27 11:20:48 +03:00
Slava Zanko
2ebdf91079 Merge branch 'm-utf-8'
* m-utf-8: (223 commits)
  Fix wildcard pattern in file select and file find dialogs
  Project builds with option --disable-charsets
  Deleted build-glib1.sh because glib1 don't work with utf-8
  fix building without --enable-charset
  Total replacement to mc_search stuff in all places
  Search engine: if found_len parameter NULL, then mc_search_run don't try to fill them
  src/view.c: Reworked search stuff to usage src/search
  refactoring: rename edit/editcmd_dialog.c:editcmd_dialog__get_search_types_list to
  Search engine: development of hex search complete
  Search engine: remove forgotten debug string and reindent file
  Search engine:
  configure.ac: if present glib-2.14 and higher, libpcre don't linked
  Search engine: now used regexp external engines:
  src/find.c: Fixed core dump if content search pattern no present
  edit/editcmd_dialogs.c: fixed state of search type between dialog window calls
  Find files: checkbox 'Regular expression' for content search now default unchecked
  Find files: changes for usage of new search engine:
  Fix copy of current/opposite path to command line: remove charset info from path
  src/Makefile.am: add some header files to Make-tracking
  Fixed editor menu reloading.
2009-05-07 13:01:01 +03:00
Sergei Trofimovich
3da14e7f8f Merge branch 'mc-4.6'
* mc-4.6:
  fish: chgrp: trac:#336; do not add exceeding quotes (fixed by snizovtsev)
2009-05-02 16:01:13 +03:00
Sergei Trofimovich
027168ce3d fish: chgrp: trac:#336; do not add exceeding quotes (fixed by snizovtsev)
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>
2009-05-02 14:09:07 +03:00
Slava Zanko
10b7bdb361 Project now build with:
make CFLAGS="-ansi -pedantic -Wall -Wextra -Werror"

WARNING! Builds wuthout samba.
2009-04-24 01:47:22 +03:00
Mikhail S. Pobolovets
1959b42fdc Merge branch '252_doxygen_desc_src'
Conflicts:

	src/file.h

Signed-off-by: Mikhail S. Pobolovets <styx.mp@gmail.com>
2009-04-16 08:26:52 +03:00
Sergei Trofimovich
15c9878d15 Merge branch 'mc-4.6'
* 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
2009-02-20 12:35:20 +02:00
Mikhail S. Pobolovets
0a7899709b Simple doxygen description for files in vfs (not subdirs) directory.
Mostly \file and \brief tag added.

Signed-off-by: Mikhail S. Pobolovets <styx.mp@gmail.com>
2009-02-10 16:18:55 +02:00
Patrick Winnertz
0b0f8e6128 Revert "introduced new type SHELL_ESCAPED_STR for more type safety"
This reverts commit 90763ba82f.

Conflicts:

	ChangeLog
	mhl/escape.h
	src/complete.c
	vfs/fish.c

Signed-off-by: Patrick Winnertz <winnie@debian.org>
2009-02-10 15:08:01 +01:00
Patrick Winnertz
8b7e47d9cc Last bunch of reverts and removal of mhl/*
Signed-off-by: Patrick Winnertz <winnie@debian.org>
2009-02-10 14:11:41 +01:00
Patrick Winnertz
f237a14635 Revert some functions (mhl_mem_free to g_free, etc)
Signed-off-by: Patrick Winnertz <winnie@debian.org>
2009-02-10 13:52:53 +01:00
Slava Zanko
e54f318cef Completely removed MHL stuff
Changed all source files relative to remove MHL

Some string-related functions moved into src/util.c

This stable fix.
2009-02-06 14:01:28 +02:00
Patrick Winnertz
3b8f37b99e Moved some functions out of mhl into src/util.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>
2009-02-06 11:17:03 +01:00
Patrick Winnertz
d8aa8a3028 Forgot to remove some more .s strings and do a rename in order to prevent compiler warnings + added include
Signed-off-by: Patrick Winnertz <winnie@debian.org>
2009-02-06 00:36:30 +01:00
Patrick Winnertz
0450daf566 Removed type SHELL_ESCAPED_STR in favour of plain char*
Signed-off-by: Patrick Winnertz <winnie@debian.org>
2009-02-06 00:20:19 +01:00
Patrick Winnertz
589ffd0b10 Use g_snprintf instead of snprintf as we switch back to glib
Signed-off-by: Patrick Winnertz <winnie@debian.org>
2009-02-05 23:49:00 +01:00
Patrick Winnertz
d84586ba82 Reverted the use of mhl_str_dup and use g_strdup instead.
Signed-off-by: Patrick Winnertz <winnie@debian.org>
2009-02-05 23:40:32 +01:00
Patrick Winnertz
1c287d798d First bunch of mhl_mem_free removal patches
Signed-off-by: Patrick Winnertz <winnie@debian.org>
2009-02-05 23:36:58 +01:00
Enrico Weigelt, metux IT service
035fa47c06 manually merged 228_replace_g_strdup 2009-02-02 21:28:01 +01:00
Enrico Weigelt, metux IT service
0434e3de5d manually merged 235_remove_g_snprintf 2009-02-02 20:53:03 +01:00
Enrico Weigelt, metux IT service
e4a4f77ac2 replaced g_snprintf() by snprintf() 2009-02-01 20:03:28 +01:00
Sergei Trofimovich
df4129517b Merge branch 'mc-4.6'
* 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
  ...
2009-02-01 14:26:54 +02:00
Enrico Weigelt, metux IT service
f921cc40cd replaced calls to g_strdup() by mhl_str_dup() 2009-01-30 20:10:40 +01:00
Sergei Trofimovich
c825c379c4 fish: cleanup: unboxed quoted strings when generate shell commands
Signed-off-by: Sergei Trofimovich <st@anti-virus.by>
2009-01-28 10:29:18 +02:00
Enrico Weigelt, metux IT service
90763ba82f introduced new type SHELL_ESCAPED_STR for more type safety 2009-01-27 22:27:06 +01:00
Mikhail S. Pobolovets
dac78460c2 Port number in shell link can be specified now
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>
2009-01-26 21:26:33 +02:00
Patrick Winnertz
7abcb66aba Merge branch 'mc-4.6' 2009-01-26 16:56:24 +01:00
Patrick Winnertz
e1572aefd3 Remove embedded function and use instead the regex directly as we doesn't need
more lines of code as really necessary.
 The regex stuff is taken from this site:
   http://www.slac.stanford.edu/slac/www/resource/how-to-use/cgi-rexx/cgi-esc.htm
2009-01-25 22:52:24 +01:00
Sergei Trofimovich
8a12b5e187 fish: fixed forgotten '\\' special char in perl escaping
Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
2009-01-25 20:22:29 +01:00
Sergei Trofimovich
a8779af1aa fish: fixed handling of files with spaces, quotes, etc.
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>
2009-01-25 20:22:29 +01:00
Sergei Trofimovich
a944b8ca5b fish: partially fixed perl backend for FISH
Broken:
 * spacy files are still broken (like " a b")
Changes:
 * vfs/fish.c learned to parse 'R' (raw filemode)
 * fixed perl backend escaping

Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
2009-01-25 20:22:29 +01:00
Sergei Trofimovich
636b1ff16f fish: added handling for escaped characters
Changes:
 * mhl/string.h achieved new function: mhl_str_dup_range
 * fish: added handling for quoted string (:"enc" and :"enc1" -> "enc2")

Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
2009-01-25 20:22:29 +01:00
Sergei Trofimovich
3884370289 fish: one step closer to working state
!!!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>
2009-01-25 20:22:29 +01:00
Patrick Winnertz
05a2491681 Argh.. we need even more escaping since this runs in c which executes
a shell script which executes then a perl script.... this uses then " as output in printf:
 --> therefore we need up to 5 backslashes
2009-01-25 20:22:29 +01:00
Patrick Winnertz
61dee5baa3 Removed a % which I accidentially overviewed the first time 2009-01-25 20:22:29 +01:00
Patrick Winnertz
837aece56f Some fixes to the new fish get dirlisting code. One issue is remaining. 2009-01-25 20:22:28 +01:00
Patrick Winnertz
b198432f06 Add some whitespace fixes which are also used to make symlinks work correctly 2009-01-25 20:22:28 +01:00
Patrick Winnertz
1667b696b7 Add new read dir stuff based on perl.
- please note that this patch won't work right now
2009-01-25 20:22:28 +01:00
Patrick Winnertz
01ef2aaf80 Revert slavaz patch because this was something unrelated to not working links via fish.
this indeed belongs into ticket:149.
2009-01-25 20:22:28 +01:00
Slava Zanko
a202cac66b Changes in directory listing format:
- 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...
2009-01-25 20:22:28 +01:00
Patrick Winnertz
56e02e2848 Remove case 'L' check as this was never implemented as it seems... 2009-01-25 20:22:28 +01:00
Patrick Winnertz
5493da68a2 Remove vars which are not needed 2009-01-25 20:22:28 +01:00
Patrick Winnertz
b166e7f232 Update Slavaz patch to work correctly on files called "foo -> bar" 2009-01-25 20:22:28 +01:00
Enrico Weigelt, metux IT service
154feb5160 2009-01-10 Enrico Weigelt, metux ITS <weigelt@metux.de>
* edit/editcmd.c:
    * src/achown.c src/background.c src/boxes.c src/chmod.c:
    * src/chown.c src/cmd.c src/command.c src/dir.c src/execute.c:
    * src/ext.c src/file.c src/filegui.c src/find.c src/help.c:
    * src/learn.c src/main.c src/panelize.c src/screen.c:
    * src/selcodepage.c src/subshell.c src/tree.c src/user.c:
    * src/utilunix.c src/view.c:
    * vfs/cpio.c vfs/direntry.c vfs/extfs.c vfs/fish.c vfs/ftpfs.c:
    * vfs/mcfs.c vfs/sfs.c vfs/smbfs.c vfs/tar.c vfs/undelfs.c:
    * vfs/utilvfs.c vfs/vfs.c:

    Changed message type codes on calls to message(), query_dialog(),
    close_error_pipe() from numeric IDs to symbols D_ERROR, D_NORMAL
2009-01-10 14:13:56 +01:00
Pavel Tsekov
d2fb34f021 * vfs/fish.c (fish_dir_load): Check the exit status of the remote command
and fail with EACCES if it was unsuccessful.
Fix the value returned on error - must be -1 instead of 1.
2007-11-02 14:50:41 +00:00
Pavel Tsekov
7d113d0125 * vfs/fish.c (FISH_OP): Remove the second argument since it is unused.
Fix the macro usage troughout.
(XTEST): Remove unused macro.
2007-10-29 13:31:44 +00:00
Pavel Tsekov
4a895496c7 * vfs/fish.c (fish_linear_start): Fix a hang when retrieving unreadable
file. Fixes savannah bug #21331.
2007-10-26 13:46:42 +00:00
Pavel Tsekov
56eccaadb4 * configure.ac: Determine the size of long', long long' and
off_t.
* vfs/fish.c (fish_linear_start): Use strtol() or strtoll() to retrieve
the size of the file being retrieved.
2007-10-11 12:32:42 +00:00