Commit Graph

182 Commits

Author SHA1 Message Date
Slava Zanko
4fc08a729e Fix broken filenames and timestamps on really poor busybox devices.
This good patch for FISH'ing to devices like my D-Link-500T :)

'busybox ls -lan'  and native 'ls -lan' is different. For example

$ busybox ls -lan /dev

drwxr-xr-x    1 0  0  0     0      0 Jan  1  1970 .
drwxrwxrwx    1 0  0  0     0      68 Dec 12  2007 ..
crw-------    1 0  0  0     0 8,   0 Jan  1  1970 .devfsd
crw-------    1 0  0  0     0 5,   1 Jan  1 12:01 console
crw-rw-rw-    1 0  0  0     0 1,   7 Jan  1  1970 full
...

and
$ ls -lan /dev
drwxr-xr-x  12 0   0     4340 Ноя 20 09:33 .
drwxr-xr-x  23 0   0     4096 Июл 29  2004 ..
crw-rw----+  1 0   0  14,  12 Июл 29  2004 adsp
crw-------   1 0   0  10, 175 Июл 29  2004 agpgart
crw-rw----+  1 0   0  14,   4 Июл 29  2004 audio

output of 'busybox ls' have two additional columns, therefore
names on filesystem shows like:
/1 12:00 proc
/1 1970 dev
/12 2007 bin
/12 2007 etc
/12 2007 lib
/12 2007 sbin
...

This patch will fix it behavior.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-12-01 21:49:12 +02:00
Alexander Moiseenko
11928eeff0 Ticket #1450: FISH: timestamps don't show correctly
Test case:
1) Make FISH-connect to some host;
2) sort files by modification time;
3) will see older files (from previous year) as new files

For check, connect to same host and enter in command line:

ls -lt

Thanks for bugreport to Alexander Glyzov.

Fix issue:
Because first part of FISH-ls script is Perl script.
But localtime function returns dates like:
Fri Sep 18 10:40:28 2009

But in utilvfs.c is written: So both year and time is not allowed.
This commit fixed write format of date.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-12-01 21:49:12 +02:00
Sergei Trofimovich
b933da347e vfs/fish.c: removed unused variable
Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
2009-08-24 09:31:26 +04:00
Andrew Borodin
fb51cb8241 Use TTY function names instead of #define's. 2009-08-12 21:23:12 +04:00
Andrew Borodin
f3730bdc41 Initial step to move TTY layer of MC to separate library. 2009-08-12 21:19:20 +04:00
Patrick Winnertz
c313396a45 Ticket #1501
* place every operation into a if clause, so that every failure of the
     operations is reported.
    * Place chown/chmod into if conditions to check if the commands where
      successfull or not on fish.
    * Added one more argument to the #CHOWN line

    Signed-off-by: Patrick Winnertz <winnie@debian.org>
2009-08-10 07:10:42 +00:00
Sergei Trofimovich
d54ea1e079 Ticket #1413 (overly quoted escaped pathnames)
> "ls -l \"/%s\" >/dev/null 2>/dev/null\n"
and longstanding one
    > "ls $LSOPT \"/%s\" 2>/dev/null | grep '[cbt]' | (\n"

Fixing again.

Signed-off-by: Sergei Trofimovich <st@anti-virus.by>
2009-07-16 09:40:34 +03:00
Slava Zanko
33c0d6f022 Fixed segfault with fish operations
Reason:
If some directory in fish is a read-only, then mc will crashed

Issue:
In fish_mkdir added additional check if directory was created.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-07-15 13:59:25 +03:00
Slava Zanko
9ee5f318ab Ticket #1395 (Copying to fish is broken)
No any files was copyed into fish.

Issue:
Files was try to create with O_EXCL flag. On fish it's fail
Now for fish flag O_EXCL will dropped.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-07-15 13:59:25 +03:00
Andrew Borodin
68354273a3 Fixed includes.
Added missed includes. Fixed includes after rebase.

Signed-off-by: Andrew Borodin <borodin@borodin.zarya>
2009-06-19 14:36:36 +04:00
Enrico Weigelt, metux IT service
c7d04dd47a fixed several missing #include's 2009-06-18 21:02:29 +04:00
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