Commit Graph

43 Commits

Author SHA1 Message Date
Slava Zanko 949d257f37 Ticket #2791: Fixed: cannot Copy/Move files with filename encoding change
Steps to reproduce:
 * run mc
 * change encoding one of panels to any different from system encoding
 * try to copy any file to panel with changed encoding

Expected result: files should be copied.

Actual result: error box here.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-08-29 13:30:28 +03:00
Andrew Borodin 908e747861 Optimization of ini files load.
Some ini files (keymaps, skins) are loaded in read-only mode. For those
files, we don't need load and keep comments.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-07-31 14:50:11 +04:00
Andrew Borodin b37af47023 Makefile.ams cleanup.
Set defines via CPPFLAGS variable not via CFLAGS one.
Use AM_CPPFLAGS and AM_CFLAGS variables instead of per-target ones.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-07-17 17:04:05 +04:00
Slava Zanko 6408811e18 Ticket #2803: fixed bug do_panel_cd: FTBFS with --enable-tests on [kfreebsd-i386,kfreebsd-amd64,ia64,armhf]
One of the panel tests fail if build environment doesn't contain the home user directory.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-06-29 13:02:30 +03:00
Andrew Borodin af3dd96e7b Tests tweak and cleanup in case of --disable-charset option usage.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-06-25 17:00:02 +04:00
Slava Zanko ca4e66d174 Ticket #2804: fixed defect: path_cmp: FTBFS with --enable-tests on [powerpc,s390,s390x]
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-06-06 16:02:30 +03:00
Andrew Borodin c1f2a8ac49 Clean up stuff that is not used anymore.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-06-05 13:06:27 +04:00
Andrew Borodin 41f7e490ea Ticket #2786: added forgotten test source file.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-04-25 19:07:48 +03:00
Andrew Borodin 1c05ebf8b9 (do_load_dir): use vfs_path_t as a path handle.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-04-22 11:25:11 +03:00
Slava Zanko 4184555b82 Ticket #2760: The password for session ftp remains in input history
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-04-12 22:31:20 +03:00
Sergei Trofimovich 41d093afaf Ticket #2768 ('make check' failed)
tests/.../do_panel_cd.c: fix test when 'HOME' contains trailing slashes.

Steps to reproduce:

    $ HOME=${HOME}/ make check
    Running suite(s): /src/filemanager
    cwd=/subvolumes/var_tmp/paludis/app-misc-mc-9999/temp
    mc_config_get_home_dir ()=/subvolumes/var_tmp/paludis/app-misc-mc-9999/temp/
    0%: Checks: 1, Failures: 1, Errors: 0
    do_panel_cd.c:86:F:Core:test_do_panel_cd_empty_mean_home:0: Assertion 'ret' failed

The patch adds home dir path normalization.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2012-04-02 20:22:27 +03:00
Sergei Trofimovich 6d3b90247b tests/.../do_panel_cd.c: show patch mismath on test failure
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2012-03-31 22:10:40 +03:00
Slava Zanko 88483f5fac Fixed creating string from relative non-local VFS.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-03-25 15:28:45 +03:00
Slava Zanko ecda2061f2 Ticket #2758: cd command not working in shell link
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-03-25 15:28:45 +03:00
Slava Zanko af1f37b967 fixup! Added tests for examine_cd() function. 2012-03-06 11:52:32 +03:00
Slava Zanko 05d220a9c6 vfs_path: Fixed broken relative paths processing.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-03-06 11:52:31 +03:00
Slava Zanko a8da7179d0 Return values of following functions are constants now:
* vfs_path_get_last_path_str()
  * vfs_path_get_last_path_vfs()
  * vfs_path_get_by_index()
  * vfs_class_find_by_handle()

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-03-06 11:52:31 +03:00
Slava Zanko c9af137914 Changed lot of functions in src/ directory
...to handle vfs_path_t objects.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-03-06 11:52:31 +03:00
Slava Zanko 2b5c28b316 Changes to handle vfs_path_t object:
* removed strip_password () function;
 * Added new vfs_path flag: VPF_HIDE_CHARSET;
 * added vfs_path_add_element() function.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-03-06 11:52:31 +03:00
Slava Zanko 18d8b06238 VFS: Added new function vfs_path_to_str_flags()
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-03-06 11:52:31 +03:00
Slava Zanko 4dde82c5be Changed do_cd() and do_panel() functions
...to handle vfs_path_t objects.

Changed panelized_panel_t.root type to vfs_path_t.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-03-06 11:52:30 +03:00
Slava Zanko a3a1e7937f Added unit test for do_panel_cd() functions.
Check if empty directory is mean 'change current directory to home dir'.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-03-06 11:52:30 +03:00
Slava Zanko ddf8c542c9 Added function vfs_path_cmp()
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-03-06 11:45:51 +03:00
Slava Zanko b319ddfbab Added vfs_path_cmp() ans vfs_path_ncmp() functions
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-03-06 11:45:51 +03:00
Slava Zanko 0aa10fd6cb Changed type of WPanel::cwd (char *) and WPanel::lwd (char *)
...to WPanel::cwd_vpath (vfs_path_tr *) and WPanel::lwd_vpath (vfs_path_t *).

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-03-06 11:45:50 +03:00
Slava Zanko 66e5af24d9 Added new fnction for manipulate vpath objects:
* vfs_path_append_vpath_new ()
 * vfs_path_vtokens_get ()

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-03-06 11:41:26 +03:00
Slava Zanko a34a3b3aa5 Added vfs_path_tokens_count() and vfs_path_tokens_get() functions
...for easy work with vfs_path_t tokens.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-03-06 11:41:26 +03:00
Slava Zanko 389ac85992 Changed input parameters of mc_mkstemp() and mc_tempdir() functions
to handle vfs_path_t type.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-03-06 11:41:26 +03:00
Slava Zanko f2dc217060 Added unit-tests for mc_tmpdir() and mc_mkstemps() functions
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-03-06 11:41:25 +03:00
Slava Zanko 8ec4f94dc6 changed interface of function mc_chdir() for handle vfs_path_t object as parameter
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2012-03-06 11:33:12 +03:00
Andrew Borodin ec476d0b88 Added tests for examine_cd() function.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2012-02-24 09:39:04 +03:00
Sergei Trofimovich 931819039e Ticket #2732: fix vfs test build failure on alpha
The test fails to compile on alpha:

>  CC     vfs_parse_ls_lga.o
> vfs_parse_ls_lga.c: In function ‘test_vfs_parse_ls_lga’:
> vfs_parse_ls_lga.c:174:9: error: unknown field ‘st_atime’ specified in initializer
> vfs_parse_ls_lga.c:175:9: error: unknown field ‘st_mtime’ specified in initializer

as st_atime on alpha in not just a field name:

struct stat {
...
    __extension__ union { struct timespec st_atim; struct { __time_t st_atime; unsigned long st_atimensec; }; };
    __extension__ union { struct timespec st_mtim; struct { __time_t st_mtime; unsigned long st_mtimensec; }; };
    __extension__ union { struct timespec st_ctim; struct { __time_t st_ctime; unsigned long st_ctimensec; }; };
};

The fix switches to old-style struct initialization.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2012-02-13 14:18:31 +03:00
Sergei Trofimovich 3e4d6d6b76 Ticket #2732: tests/lib/vfs/Makefile.am: drop muldefs from CFLAGS
Otherwise gcc on alpha/arm will break in gcc -c phase:

      CC     config_string.o
    armv5tel-softfloat-linux-gnueabi-gcc <skip>  -z muldefs -c config_string.c
    armv5tel-softfloat-linux-gnueabi-gcc: muldefs: No such file or directory
    make[4]: *** [config_string.o] Error 1

Gentoo-bug: http://bugs.gentoo.org/403343
Reported-by: Markus Meier
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2012-02-13 14:18:16 +03:00
Slava Zanko 162a330f42 Added unit test for mc_config_get_full_path() function
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-12-06 16:24:10 +03:00
Slava Zanko 490711fca7 Added forgotten file to distribution for tests
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-10-19 15:06:40 +03:00
Slava Zanko 0138645541 Ticket 1551: Update GPL version from 2 to 3
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-10-18 14:08:34 +03:00
Slava Zanko 4e295b261b vfs_parse_ls_lga: The checks for timestamp is commented out.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-10-18 13:36:06 +03:00
Slava Zanko 1759de7cd5 Include config.h to all test's files
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-10-17 15:15:15 +03:00
Slava Zanko d5e6dceed8 vfs_parse_ls_lga: Make tests output more verbose
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-10-17 14:57:28 +03:00
Andrew Borodin 79023b26a4 (mc_build_filename): incorrect processing of first element of path.
If first element is relative, the result path should be also relative
not absolute.

If first element is empty, the result path is relative.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2011-10-17 13:30:03 +03:00
Slava Zanko 12dfe1bd55 VFS ftpfs: fixed broken filenames in unaligned 'ls' command output
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-09-08 20:10:48 +03:00
Slava Zanko 20a79d52ab Ticket #2595: Broken panels recode in current master
Fixed path recoding

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-09-08 13:50:02 +03:00
Slava Zanko d3bb9de01f Ticket 2570: Code cleanup
Moved tests from lib/tests to tests/lib directory

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2011-07-11 20:23:44 +03:00