Commit Graph

3748 Commits

Author SHA1 Message Date
Francesco Cosoleto
36771dcfa2 Ticket #2014: don't try to make directory NULL named in mkdir_cmd().
As input_expand_dialog() may return a pointer to an empty string,
the function was trying to create a directory so named and thus
print a false "File exists" error message.

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-03-17 13:39:02 +00:00
Ilia Maslakov
4b0b9878ac Ticket #2094 (after option "Cursor beyond end of line" switch off cursor still beyond end of line)
fixed position of cursor after disable option "Cursor beyond end of line" in editor options dialog.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-03-16 14:04:35 +03:00
Slava Zanko
320803812b Fixed fileOperation dialog height for copy/move operations (with verbose mode switched off)
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-03-12 00:09:02 +02:00
Slava Zanko
3fb63c55ca Ticket #2099: Delete dialog broken when verbose mode is switched off
Test case:
1. go to Options/Configuration
2. switch Verbose operation off
3. point at a directory, press F8

You see broken delete dialog.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-03-11 17:59:08 +02:00
Ilia Maslakov
bbb9b8bafc Ticket #1770 (compilation error)
fixed compilation error with tcc.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-03-10 11:21:45 +03:00
Andrew Borodin
d2a9152cec Ticket #2087: crash in standalone editor and viewer.
Don't try update file manager panels if mc runs as standalone editor or viewer.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-03-06 11:08:18 +03:00
Mikhail S. Pobolovets
93494a6d27 edit-widget.h, syntax.c: MC indenation policy has been applied
Signed-off-by: Mikhail S. Pobolovets <styx.mp@gmail.com>
2010-03-04 18:55:28 +02:00
Mikhail S. Pobolovets
9537ff6fe0 Ticket #1770: added switch 'caseinsensitive' for syntax highlighting
Signed-off-by: Mikhail S. Pobolovets <styx.mp@gmail.com>
2010-03-04 18:42:58 +02:00
Andrew Borodin
a4e508d0ac widget.c: applied MC indenation policy.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-03-04 16:03:24 +00:00
Andrew Borodin
0a85086ba3 Ticket #2077: free kill_buffer after WInput destroy.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-03-04 15:41:12 +00:00
Andrew Borodin
57bb9cb536 WInput: type accuracy.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-03-04 15:41:12 +00:00
Andrew Borodin
da81bbb9dc Ticket #2082: don't save input line content in history if dialog was canceled.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-03-04 15:41:12 +00:00
Andrew Borodin
0607f23691 Ticket #2067: fixed toggle of ruler state.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-28 20:33:37 +03:00
Andrew Borodin
7b9226c5da Ticket #2068: fixed segfault in panelization of file find result.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-28 20:10:20 +03:00
Andrew Borodin
3587a3698d Ticket #1701: set help background color using skin color.
The value of help._default_ skin entry is used to set color
of background and title in help window.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-28 19:57:24 +03:00
Slava Zanko
5354d59337 Identation of some source files.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-02-26 11:26:00 +02:00
Slava Zanko
efb3042f29 avoid often memory alocation&release
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-02-26 10:58:49 +02:00
Slava Zanko
054c5d6f44 x86_64: Cleanup of code for master
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-02-26 10:58:49 +02:00
Andrew Borodin
080d8e3be5 Avoid double check some panel values before call of select_item().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-26 10:58:49 +02:00
Slava Zanko
1b75ea27b6 Cleanup of code for master
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-02-26 10:58:49 +02:00
Ilia Maslakov
cf16304bf6 Ticket #1986 (not converted text in confirm dialog)
fixed encoding of text in 'Confirm replace' dialog.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-02-25 19:55:59 +03:00
Andrew Borodin
a78115ad8e Fixed variable declarations and added missing includes.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-24 16:22:43 +00:00
Andrew Borodin
45073c35e7 Ticket #1992: incorrect sturtup of MC with some special paths.
Problem description:
  1. Run mc as
     mc /#ftp:user@server
  2. If FTP server asks password, MC shows the password dialog window.
  3. If type the first symbol in input line, MC crashes.

Bug cause:
  MC asks ftp password before initialize of input line keybindings.

Solution:
  Reimplemented MC startup sequence.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-24 16:22:43 +00:00
Slava Zanko
02ae5b904e Change param name from 'Layout.progressbar_always_left2right' to 'Layout.classic_progressbar'
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-02-24 10:40:40 +02:00
Slava Zanko
e1d1e9254d Change progressbar dialog.
* Minimizing dialog;
 * Optimizations of Copy/move progress dialog creation;
 * Added enum for specify dialog type (for copy/move or for delete)
 * Little optimization.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-02-24 10:40:11 +02:00
Slava Zanko
88a374a432 Added ability to show progressbars (when copy files) from right to left.
For activate this, need to add into ini-file:

[Layout]
progressbar_always_left2right=0

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-02-24 10:37:43 +02:00
Slava Zanko
804ca8e7b0 Added indication of total BPS and ETA for file operations.
* Optimized functions calls (changed return type of all file_progress_show*() functions)
 * Reworked for use global structure FileOpTotalContext
 * Moved declarations of file_progress_show*() functions from fileopctx.h to filegui.h
 * Code for calculate progressbar's variables was moved into function copy_file_file_display_progress()
 * Progressbar for little files now shows always 100% (for visible effect)
 * Added i18n string '< 1 sec'
 * Rework of progress copy dialog

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-24 10:37:43 +02:00
Slava Zanko
c40c5014b9 Widget library: added new widget WHLine.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-24 10:37:42 +02:00
Andrew Borodin
334560adac Show Count progress bar before copy/move of 1st file,Z not after.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-24 10:37:42 +02:00
Andrew Borodin
47abf9282f copy_file_file(): create file copy buffer in stack instead of heap.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-24 10:37:42 +02:00
Andrew Borodin
159f5fdff1 Type accuracy in file operation routines.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-24 10:37:42 +02:00
Andrew Borodin
a18c13d0c9 Reimplemented some gotos in panel_operate().
Also some type accuracy and minor optimization were made.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-24 10:37:42 +02:00
Andrew Borodin
f5beb5b2c6 Ticket #1443: show average copying velocity/ETA for whole operation.
Problem description:
  Let's consider large directory (~4GB) with relatively small files:
  each 1-2MB.
  When I try to copy whole directory I would like to see average
  copying velocity (and ETA) not only per-file (I just don't see
  stats for small files), but for the whole progress.

This commit fixes the issue. Thanks Sergey <sergemp at mail dot ru>
for the initial patch.

Additionally, the minor type accuracy was provided.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-24 10:37:42 +02:00
Andrew Borodin
492ccbe0ee Ticket #1999: changed color of inactive visible main menu.
Added 'menuinactive' skin item to draw incative visible
main menu.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-23 19:01:56 +03:00
Andrew Borodin
2eec76f8c5 Retain search options in viewer across viewing session.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-22 14:59:47 +03:00
Andrew Borodin
63aa191e7a Ticket #1572: retain search/replace options in editor.
Retain search/replace options in editor across editing session.
Type accuracy.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-22 14:59:46 +03:00
Andrew Borodin
08b708c5bb Ticket #1940: verbose option cannot be switched off.
How to reproduce:
  1) run mc
  2) press F9
  3) select 'Options' -> 'Configuration...'
  4) switch off '[ ] Verbose operation' option
  5) select '[ Save ]' button and press Enter
  6) in additional, select 'F9' -> 'Options' -> 'Save setup'
  7) exit from mc
  8) run mc again
  9) select 'F9' -> 'Options' -> 'Configuration...'

'Verbose operation' option always switched on.

This commit fixes this behaviour. But in slow terminals,
the value read form ini is forced set to 0.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-22 12:25:08 +03:00
Slava Zanko
e723926cd0 Height of 'Sort order' dialog window now calculated automatically
relative to count of sort modes.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-02-22 11:08:37 +02:00
Vladimir Brednikov
3c4221bc40 Ticket #1994: Sort files by version (like strverscmp(3) does)
Suppose we have 3 files with version in their names:
 * file-2.1.tgz
 * file-2.2.tgz
 * file-2.10.tgz

It is impossible to see them in natural order using standard facilities,
they will be sorted in alphabet order:
 * file-2.1.tgz
 * file-2.10.tgz
 * file-2.2.tgz

There was some attempts to fix this. I've picked up the patch by Roland Illig <roland illig gmx de>
(http://mail.gnome.org/archives/mc-devel/2004-July/msg00016.html) and adopted it for today's git snapshot.
It adds "version" option to the sort menu, which uses copy of strverscmp function from glibc.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-02-22 11:08:37 +02:00
Sergei Trofimovich
5a714baeaf panel search crash due to strescape.h include missing from screen.c (ticket #2044)
> In current git, mc crashes (at least on 64-bit) in Ctrl-S search due to missing
> strutils_escape prototype. To reproduce, pressing Ctrl-S and a few keys is enough.
> Adding #include "lib/strescape.h" to screen.c fixes the issue.

Reported by jmak

Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
2010-02-21 20:51:26 +02:00
Andrew Borodin
b52e70637e show help for quick search.
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-02-20 11:25:30 +00:00
Ilia Maslakov
be05d210c3 cleanup of screen.c: do_search() function (indentation and trailing whitespace)
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-02-20 11:25:29 +00:00
Ilia Maslakov
dde06f0503 do_search(): minor optimization.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>

    fix trouble with unescaped ',|\\[]{}'

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-02-20 11:25:29 +00:00
Slava Zanko
7e8975e022 quicksearch: stop appending of chars if no file found
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-02-20 11:25:29 +00:00
Ilia Maslakov
38008d6580 Ticket #2022 (new quick search)
changed quick search engine, now search with wildcards.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-02-20 11:25:28 +00:00
Ilia Maslakov
b0236c3e10 Ticket #1998 (EditColumnMark can't go up through newline)
fixed trouble with vertical selection

more detail description:

In block selection mode (shift-F3) it's impossible to go beyond empty line with
up or left arrow (i.e. in top direction).
In general: it's impossible to pass any line shorter than finishing column,
until left arrow is pressed at column 0 (which won't work on empty line), e.g.

xxxCxxx
yyyyy
zzzzzDz

- put cursor in C position,
- press shift-F3,
- go to D position,
- press up arrow twice,
- press left arrow - you're unlocked now and free to go up.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-02-19 12:59:10 +03:00
Andrew Borodin
163b07d23f Ticket #2008: reimplemented pty_buffer as static buffer.
Reimplemented pty_buffer as static buffer to avoid
MC crashes at exit due to race conditions of destroing
subshell and file manager.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-19 11:30:29 +00:00
Slava Zanko
0ebd30cd50 Merge branch '1917_viewer_search_again'
* 1917_viewer_search_again:
  Ticket #1917: again search in viewer
2010-02-15 17:19:38 +02:00
Slava Zanko
9e2768be46 Ticket #1917: again search in viewer
Added new confirm box for repeat search from begining of file

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-02-15 17:17:27 +02:00
Martin Petricek
7c3196b60e Ticket #1767: Custom/locale-based date format
Fixed showing of datetime format in various locales (such as Polish locale)

Added new options in config file:

[Misc]
    ...
    timeformat_recent=%d.%m.%y %H:%M
    timeformat_old=%d.%m.%y %H:%M
    ...

where
    timeformat_recent - for files with mtime between now
                         and "6 moths old" (like "Nov 2 00:56")
    timeformat_old    - for other files (like "Jun 23 2007")

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-02-15 12:31:47 +02:00
Slava Zanko
f9b956b483 Ticket #1996: ViewContinueSearch segfault on empty search
Steps to reproduce:
1. F7,
2. set empty search string,
3. enter
4. n
5. enter
6. n

Fix issue: set view->last_search_string to NULL after call g_free()

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-02-12 13:02:26 +02:00
Leonid Myravjev
56d955152c Ticket #1838: source_codepage autodetect with enca program.
Added support of autodetect codepages via 'enca' program.

New parameter in user configuration file (~/.mc/ini):

[Misc]
autodetect_codeset=(one of `enca --list languages | cut -d : -f1`)

Signed-off-by: Slava Zanko <slavazanko@gmail.com>

Little code cleanup.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>

Type accuracy. Added missing includes.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-08 15:56:48 +02:00
Andrew Borodin
36b2136391 Fixed listbox scrolling after item deletion.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-04 13:42:44 +00:00
Andrew Borodin
361f95a976 Minor optimization of listbox_key() function.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-04 13:42:44 +00:00
Andrew Borodin
081723c4e7 Removed double check of panel history before show it.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-04 13:42:44 +00:00
Andrew Borodin
9bc2066b1f Added history cleanup capability.
New shortcuts of WListbox widget:
d or Del: remove current item of history;
D or Shift-Del: clean the history.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-04 13:42:44 +00:00
Andrew Borodin
2a8817b9be Changed i18n stuff of Confirmation dialog window.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-04 13:42:44 +00:00
Andrew Borodin
ad60c3fd8d Preparation to history cleanup confirmation.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-04 13:42:44 +00:00
Andrew Borodin
43ca270f99 Scroll list if last item have been deleted.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-04 13:42:44 +00:00
Andrew Borodin
9a9e003243 History items can be deleted now using DEL key.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-04 13:42:44 +00:00
Andrew Borodin
5718372338 Reimplemented usage of history list in history dialog.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-04 13:42:44 +00:00
Andrew Borodin
1947d842a5 Added deletable member to WListbox structure.
Added deletable member to WListbox structure to enable
delete some list entries.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-04 13:42:44 +00:00
Andrew Borodin
1695465594 Added listbox_set_list() function.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-04 13:42:44 +00:00
Andrew Borodin
1d16fd3a88 Small refactoring of history engine.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-04 13:42:44 +00:00
Andrew Borodin
32c580ee87 Reimplemented WListbox to use GList.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-04 13:42:43 +00:00
Andrew Borodin
aac16c693d Ticket #1445: remove history items.
Initial step: optimizatiom of listbox_remove_current() function.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-04 13:42:43 +00:00
Slava Zanko
2b653ecf33 Ticket #1991: toggle panels view
Added keybinding for switch panels view (horizontally/vertically).

Default value for keybind is
[main]
CmdTogglePanelsView = alt-comma

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-02-04 11:29:16 +02:00
Andrew Borodin
7bf935ad83 Fixed warning: ISO C90 forbids mixed declarations and code.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-02 21:55:37 +03:00
Andrew Borodin
7f50de4670 Added missed includes.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-02 21:45:11 +03:00
Andrew Borodin
0bd03e07f5 Ticket #1990: code cleanup before 4.7.0.2 release.
Fixed warings: local variable shadows a global declaration.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-02-02 21:45:05 +03:00
Andrew Borodin
0d12e0def8 Ticket #1702: changed colors of alvays visible inactive menu bar.
If menu bar is always visible, default colors are used in menu.
If menu bar is visible when it is active, skin colors are used.

In this commit, only skin colors are applied to menu. Thanks to
Rashid N. Achilov for idea.
(see http://mail.gnome.org/archives/mc/2010-January/msg00087.html).

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-02-01 15:58:01 +00:00
Slava Zanko
5975418163 edit.c: Some code refactoring&cleanup
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-29 18:05:03 +02:00
Slava Zanko
cd9e93b2d1 Ticket #1982: Segfault while opening gzip archive
1. touch /tmp/IzV-Útěk_do_bezpečí.gz
2. open mc
3. move cursor at /tmp/IzV-Útěk_do_bezpečí.gz
4. press F4
5. you will see an error message, press Dismiss
6. segfault

Fix issue: length of command line string for pipeing  now calculated
automatically (via g_strdup_printf()) rathen than calculating via
str_term_width1() function.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-29 18:05:03 +02:00
Ilia Maslakov
519e2a30cb Ticket #1956 (mcedit: moving cursor to the empty last line problem)
fixed cursor movement in empty last line.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-01-29 15:07:34 +03:00
Andrew Borodin
70a41e4fed Ticket #1935: Incorrect lock files check when hostname contains wide characters.
Bug: in lock_extract_info() number of unicode characters
is used as number of bytes in string.

Now strlen() is used instead of str_term_width() to calculate
string length. String length is calculated only one time.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-01-26 13:18:21 +00:00
Slava Zanko
9104ad78e1 src/viewer/display.c: added forgotten #include "src/charsets.h"
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:26 +02:00
Slava Zanko
8172b511bb Removed src/pipethrough.* files.
Glib have fully-functional replacement:
http://library.gnome.org/devel/glib/stable/glib-Spawning-Processes.html

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:26 +02:00
Slava Zanko
862652bd1b Move src/cons.saver into src/consaver/* subdir
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:26 +02:00
Slava Zanko
2fa4d9b952 Move logging.[ch] into library
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:26 +02:00
Slava Zanko
e07ba16b3b Moved strecape.[ch] into library
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:25 +02:00
Slava Zanko
108666b192 Added include of "fileloc.h" into subshell.c file
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:25 +02:00
Slava Zanko
25155c311a Move all interface includes from subdirs lib/*/*.h into lib/*.h
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:25 +02:00
Slava Zanko
7815c9c7a8 Reorganization of usage external libs
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:24 +02:00
Slava Zanko
cd4dbf3a09 Changes for build after moving strutil into lib
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:24 +02:00
Slava Zanko
7fa24fbc9b Moved strutil-related stuff from src into lib/strutil/*
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:24 +02:00
Slava Zanko
c764f3b84c Changes for build after moving util.[ch]
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:24 +02:00
Slava Zanko
99abd3ab9a Moved src/util.[ch] into lib, also moved unixcompat.h and utilunix.c.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:23 +02:00
Slava Zanko
dbaff2b6f6 Reorganization of sources. Part 2
* moved src/fileloc.h into lib/fileloc.h
 * moved src/timefmt.h into lib/timefmt.h
 * removed unneedded includes into src/util.c

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:23 +02:00
Slava Zanko
93dbc46e9c Reorganization of sources. Part 1.
* moved src/global.h into lib/global.h
 * moved glibcompat.[ch] from ./src/ into ./lib/
 * moved fs.h from ./src/ into ./lib/

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:23 +02:00
Slava Zanko
8610cdfa80 global.h Removed unneeded include of file "textconf.h"
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:23 +02:00
Slava Zanko
39d5b94cac Reorganized pathes to files in '#include' directives 2010-01-26 10:30:22 +02:00
Slava Zanko
ddb9ada2e8 Changes in sources matched with mass movement of $(srcdir)/src/*/ into $(srcdir)/lib/*/
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:22 +02:00
Slava Zanko
4f11e4b665 Massive moved some dirs from $(srcdir)/src into $(srcdir)/lib
Moved subdirs:
 * filehighlight
 * mcconfig
 * search
 * skin
 * tty

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:22 +02:00
Slava Zanko
43805741aa Changes in sources matched with movement of $(srcdir)/vfs into $(srcdir)/lib/vfs/mc-vfs
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:21 +02:00
Slava Zanko
52f6bed7d0 Moved dir $(srcdir)/vfs into $(srcdir)/lib/vfs/mc-vfs
Also, initial support of library directory.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:21 +02:00
Slava Zanko
f90725ad0d Changes in sources matched with movement of $(srcdir)/edit into $(srcdir)/src/editor
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:19 +02:00
Slava Zanko
871991dda0 Ticket #1866: Move edit/ and vfs/ directories into src/
Moved dir $(srcdir)/edit into $(srcdir)/src/editor

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:30:19 +02:00
Slava Zanko
9fdfbf64cb Ticket #1973: Segfault in 'Listing mode' dialog
Test case:
 * run mc
 * Select F9 => 'Left/Right' => 'Listing mode...'
 * [x] user Mini status
 * enter below: 'half type name | size+ | perm'
 * Press [< OK >] button

Fix issue: alloc new block of memory with initialization (filled by zero)

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-26 10:25:00 +02:00
Andrew Borodin
fef45001b0 Ticket #1955: Incorrect input line length in 'Edit symlink' dialog window
If symbolic link has a long name, the input line in 'Edit symlink'
dialog window is short. This bug is reproduces in non-C locales (KOI8-R,
UTF-8, etc).

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-01-21 14:34:46 +00:00
Ilia Maslakov
3d184b4be6 Ticket #1945 (new editor action - select all/mark all)
add new editor action - 'Mark all', allow select all text in the current file.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-01-20 13:08:37 +03:00
Ilia Maslakov
1eeffc2803 added new parameter mcview_eof into ini-file
if mcview_eof defined show mcview_eof as EOF

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-01-19 19:15:30 +00:00
Ilia Maslakov
8e68c5614a added procedure mcview_update_filesize,
now mcview reread the file size before goto bottom the file.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-01-19 19:15:30 +00:00
Andrew Borodin
4197af0048 Optimization of viewer screen content update.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-01-19 19:15:29 +00:00
Nikita Ofitserov
efb28521f5 Fixed left/right movement in hex mode
Signed-off-by: Nikita Ofitserov <himikof@gmail.com>
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-01-19 19:15:29 +00:00
Andrew Borodin
a617e68090 Fixed viewer button bar.
Set F5 button label ("Goto") the same for plain and hex modes.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-01-19 19:15:29 +00:00
Andrew Borodin
e3589ee4d8 New 'Goto' dialog implementation in viewer.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>

Removed mcview_moveto_addr_cmd, mcview_moveto_line_cmd,
mcview_moveto_cmd.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-01-19 19:15:29 +00:00
Ilia Maslakov
b1de9bbd80 Little refactoring of load_file_position, save_file_position (added new param 'offset')
Now viewer save/load only 'offset' and 'line' always = -1.
Changed editor edit_load_position, edit_save_position,
now if 'line' = -1 then used 'offset'

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-01-19 19:15:28 +00:00
Ilia Maslakov
f31bbc49a6 Fixed drawing of viewer status bar.
added drowing selected codepage in statusbar

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-01-19 19:15:04 +00:00
Ilia Maslakov
90913731c0 this commit make the viewer faster.
remowed all no needed calls of mcview_offset_to_coord and mcview_coord_to_offset
    added mcview_eol, mcview_bol for navigate in current file

    thanx Nikita Ofitserov <himikof@gmail.com> for the patches and testing

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-01-19 14:21:04 +03:00
Andrew Borodin
335c1779eb First step of viewer coordinates cache reimplementation.
Reimplemented some of coordinates cache internals.
    Array is used instead of GList. If needed, array is reallocated.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-01-18 17:55:16 +03:00
Andrew Borodin
d2668b188a Ticket #1585: mc viwer is slow.
Initial commit: minor refactoring:
    rename coord_cache_entry to coord_cache_entry_t.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-01-18 17:55:16 +03:00
Andrew Borodin
c6702258de Ticket #1965: fixed handling of Tree in 'Find File' dialogue.
The Start at prompt is filled with garbage every time
the Tree option is entered in the Find dialogue.

To reproduce:
1. M-? to open Find dialogue
2. not that the Start at prompt is empty
3. press M-T or navigate to Tree button and press enter
4. you see tree view, press ESC
5. the Start at prompt is filed by garbage

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-01-18 16:29:52 +00:00
Slava Zanko
57a6a26be7 Ticket #1657: Transparency support is broken in 4.7.0-pre3
The latest version breaks transparency support.
If I'd change _default_ to lightgray;default in the [core] section, the panels are unreadable.
It looks like the _default_ variable interpreted as lightgray;lightgray.

Fix Issue: do not apply COLOR_WHITE as mask if color value equal to -1

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-16 15:12:35 +02:00
Enrico Weigelt, metux IT service
86c345cd4b More HAVE_TERMIOS_H removals 2010-01-15 00:58:50 +01:00
Enrico Weigelt, metux IT service
4a4fc37f53 Ticket #1932: Removed obsolete checks for standard header termios.h 2010-01-15 00:58:50 +01:00
Enrico Weigelt, metux IT service
e0ba3c583f Ticket #1930: src/strutil8bit.c: fixed missing include of fs.h 2010-01-15 00:56:38 +01:00
Enrico Weigelt, metux IT service
7cb7acb14c Ticket #1960: src/mcconfig/common.c: fixed missing printf format in mc_config_new_or_override_file() 2010-01-14 20:12:06 +01:00
Andrew Borodin
23cd4b9cb3 Ticket #1944: incorrect draw of wrapped lines.
If viewer is in wrap mode, there is an expta empty line
in wrapped line. This bug was introduced in
8c84095ae1 commit.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-01-14 16:28:51 +00:00
Enrico Weigelt, metux IT service
f1cf193877 VFS: removed obsolete src/vfsdummy.h 2010-01-13 12:34:08 +00:00
Enrico Weigelt, metux IT service
cb56023b4d VFS: moved functions from src/vfsdummy.h to vfs/vfs.h 2010-01-13 12:34:07 +00:00
Enrico Weigelt, metux IT service
491b88eae9 Ticket #1931: VFS: added missing includes of vfs/vfs.h 2010-01-13 12:34:07 +00:00
Andrew Borodin
6123cac32b Ticket #1954: check pointers to GArray before deletion.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-01-12 13:42:02 +00:00
Sergei Trofimovich
9938ee796f (error) Resource leak: f
Fixed opened file leak on certain kind of errors.
Thanks to cppcheck.

Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
2010-01-11 15:32:39 +02:00
Milan Cermak
d80f098c11 Ticket #1942: MC crashes on exit when using C locale.
Starting mc with:
LANG=C mc
cases a crash when mc exits. No other LC_* variable was set.

The issue is in src/strutil.c module. With C locale, str_init_strings()
fails to set str_cnv_not_convert variable leaving it with value -1
(INVALID_CONV). str_uninit_strings() passes str_cnv_not_convert blindly
to g_iconv_close() which tries to dereference it.

This commit adds a check to str_uninit_strings() if str_cnv_not_convert
value is valid.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-01-06 18:46:09 +03:00
Andrew Borodin
38eeaa180c Show not-printable 8-bit symbols in non-UTF-8 locales as dots.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-01-06 18:12:53 +03:00
Andrew Borodin
962dd4d81f Minor optimization of MC viewer.
Call mcview_compute_areas() not so often.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-01-06 18:12:53 +03:00
Andrew Borodin
8c84095ae1 Fixed boundaries of display text area.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-01-06 18:12:53 +03:00
Andrew Borodin
b330358440 Fixed show of viewer status bar.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-01-06 18:12:53 +03:00
Andrew Borodin
8d70916abd MC Viewer API unification: arguments order was changed.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-01-06 18:12:53 +03:00
Andrew Borodin
1055b85072 Ticket #1918: viewer in QuickView mode corrupts screen.
Initial step: code refactoring:
  * small code formatting;
  * type accuracy;
  * introduce new type 'panel_view_mode_t' for panel type.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-01-06 18:12:53 +03:00
Andrew Borodin
462315fe09 Save find file options in user configuration file.
The new section [FindFile] was created for find file options.
The find_ignore_dirs key in Misc section is obsolete now.
The ignore_dirs key in FindFile section is used instead.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-01-06 18:04:50 +03:00
Andrew Borodin
839816f3fe Ticket #1874: save file find options between MC sessions.
Initial step: code refactoring. Join find options (checkbox
values) in structure.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-01-06 18:04:50 +03:00
Andrew Borodin
6d9e319106 Ticket #1936: segfault in input line history.
If input line history contains only one item, pressing M-p
("Previous history item") causes a segmentation fault.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2010-01-06 15:49:51 +03:00
Ilia Maslakov
c3755f0c50 added keybind CK_Toggle_Show_Margin for toggle show right margin (with empty default key)
added new color pair for right margin (editrightmargin) into skins

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-01-06 14:31:40 +03:00
Ilia Maslakov
7c2692cf8c add new etitor parameter editor_show_right_margin
Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-01-06 14:26:02 +03:00
Ilia Maslakov
5203d6739d Ticket #1514 (show right margin)
* added new color pair EDITOR_RIGHT_MARGIN_COLOR
    * show right margin. Used EDITOR_RIGHT_MARGIN_COLOR color for drawing text beyond rigth edge.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-01-06 14:26:01 +03:00
Ilia Maslakov
b1c97f6c5b Ticket #1915 (not finished comment)
fixed wrong not finished comment

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2010-01-02 23:58:23 +00:00
Enrico Weigelt, metux IT service
8c9619cef1 Replaced WITH_SMBFS by ENABLE_VFS_SMB 2010-01-02 16:29:24 +01:00
Slava Zanko
d5526e13dc Removing calls of strerror() function in mc-core
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2010-01-02 07:11:01 +01:00
Enrico Weigelt, metux IT service
ec1a52fb0a VFS: renamed USE_VFS to ENABLE_VFS 2009-12-30 11:06:11 +02:00
Enrico Weigelt, metux IT service
c40d1c09bd src/file.c: Fixed warning on unused parameter on non-vfs build 2009-12-30 11:06:11 +02:00
Enrico Weigelt, metux IT service
bc0a91e931 VFS: removed duplicate O_LINEAR declaration in src/vfsdummy.h 2009-12-30 11:06:11 +02:00
Enrico Weigelt, metux IT service
e2e490a054 VFS: fixing symbol clash on mc_ungetlocalcopy() at non-vfs build 2009-12-30 11:06:10 +02:00
Enrico Weigelt, metux IT service
9571b0ac15 VFS: fixing symbol clash on mc_readlink() at non-vfs build 2009-12-30 11:06:10 +02:00
Enrico Weigelt, metux IT service
1ee19ccdc2 VFS: fixing symbol clash on mc_utime() at non-vfs build 2009-12-30 11:06:10 +02:00
Enrico Weigelt, metux IT service
8cade48b13 VFS: fixing symbol clash on mc_write() at non-vfs build 2009-12-30 11:06:10 +02:00
Enrico Weigelt, metux IT service
1b11c35b2b VFS: fixing symbol clash on mc_read() at non-vfs build 2009-12-30 11:06:10 +02:00
Enrico Weigelt, metux IT service
54f302e2c9 VFS: fixing symbol clash on vfs_file_is_local() at non-vfs build 2009-12-30 11:06:09 +02:00
Enrico Weigelt, metux IT service
49c83d786c VFS: fixing symbol clash on vfs_current_is_local() at non-vfs build 2009-12-30 11:06:09 +02:00
Enrico Weigelt, metux IT service
b86788822d VFS: fixing symbol clash on vfs_init() and vfs_shut() at non-vfs build 2009-12-30 11:06:09 +02:00
Enrico Weigelt, metux IT service
80b3776c20 VFS: fixed lots of missing includes to vfs/vfs.h 2009-12-30 11:06:09 +02:00
Enrico Weigelt, metux IT service
af2f1f650b Ticket: #1913: Fixed warn/break on unsed static function str_utf8_create_key_for_filename()
Unused static function causes build to break on -Werror.
Fixing this by commenting it out.
(not removing it since it might get used some day)

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-12-30 11:01:09 +02:00
Sergei Trofimovich
80fc7fe9ed Ticket: #1903: fish: mc hangs on any operation with files containing "'"(quote)
During last major escape transition "foo" -> properly_escaped_foo we forgot
to add "'" to list of specialcased symbols. This leads to mc hangup when you
try to do something with files/dirs, containing that symbol.

Adding it!

Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
2009-12-25 20:42:23 +02:00
Slava Zanko
4f36622725 Ticket #1828: Improved symlink handling in ftpfs
Originally from: http://mail.gnome.org/archives/mc-devel/2005-April/msg00035.html

The routines `vfs_s_find_entry_linear()' and `vfs_s_find_entry_tree()'
call `canonicalize_pathname()' on entry. This routine eats `..' path
components in certain cases. In case of ftpfs this is not desired -
the path should be kept as is since the code in direntry.c doesn't have
enough knowledge of the directory structure on the remote end.

Assume that
there is a path like this on the remote server

    /path1/path2/path3

The `path2' component is a symlink to some directory and `path3' is a
symlink stored in `path2' which is relative to `path2' i.e.

path2

    path3 -> ../some/other/path

Now, the code in direntry.c will determine that `path3' is a symlink and
will try to resolve (vfs_s_resolve_symlink) it by passing the following path

    /path1/path2/../some/other/path

to `vfs_s_find_entry_linear' . As I've said above this routine calls
`canonicalize_pathname' on entry which will modify the path like this:

    /path1/some/other/path

Now this is clearly wrong since `path2' is a symlink and it should be
resolved first. In the case of ftpfs the code in direntry.c doesn't have
enough knowledge about physycal directory layout on the remote filesystem
so it shouldn't try to canonicalize the path. The path should be left as
is and passed to the remote end for processing.

Fix issue:
Changed function canonicalize_pathname (as fact, renamed to custom_canonicalize_pathname)
In this function added ability to partial canonicalize of pathname.
And some functions from vfs/direntry.c calls custom_canonicalize_pathname without
removal of '..' stuff.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-12-25 15:53:48 +02:00
Slava Zanko
4f88a84526 Ticket #1663: Panels state saves and restores despite disabled 'Auto save setup'
Added option 'auto_save_setup_panels' into [Midnight-Commander] section of ini-file.
If no specified, value of this option is equal to value of 'auto_save_setup' option.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-12-25 13:23:05 +02:00
Andrew Borodin
a20ebb3818 Ticket #1876: use Ctrl-g key to generate SIGINT signal.
Ctrl-g instead of Ctrl-c is used now to generate SIGINT signal.
SIGINT signal generating for MC/NCurses library is enabled now.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-25 12:01:18 +00:00
Andrew Borodin
bce9bc5027 Ticket #1883: fixed handling of 0xff character in WInput widget.
The 0xff character is valid character in CP1251 codepage,
therefore the proper unsigned extension of char to int
is required in stuff() function to avoid the 0xff as -1
interpretation in handle_char() function.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-24 22:17:31 +03:00
Slava Zanko
62ece7e048 viewer: now show warning if matches not found
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-12-23 21:15:50 +02:00
Slava Zanko
46f6c4d1b7 Ticket #1873: Viewer: hangup after search in archive
viewer hangup after search in archive

Test case:
 * download ftp://ftp.slackware-brasil.com.br/slackware-12.0/testing/MANIFEST.bz2 or any slackware MANIFEST.bz2 from internet
 * F3 under MANIFEST.bz2
 * F7 "fortunes-o.tar.gz"<enter>
 * hangup

Fix issue:
 * Change growbuff from owm implementation into g_ptr_array
 * Fixed calculating of search_start position
 * Search module: fixed checking for return code from update callback
 * Search module: Added return code MC_SEARCH_CB_OK for search callbacks
 * Added exit on keyboard break
 * Fixed search in last grow'ed block

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-12-23 21:15:41 +02:00
Aliaksey Kandratsenka
233f943e87 don't set TOSTOP attribute on slave terminal
TOSTOP doesn't work well with some software. Examples known to me are:
- debugging multithreaded program with gdb (gdb job stops)
- running 'check' tests in fork mode (default) that do some output
(tests mysteriously fail due to timeout)

IMO TOSTOP adds too little value compared to compatibility problems it
creates.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-12-23 15:36:14 +02:00
Andrew Borodin
c9a1c7f39e Ticket #1876: Fix of Ctrl-c behaviour for S-Lang.
Since Ctrl-C is used as common shortcut, don't use it
to generate the SIGINN signal in S-Lang library.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-16 17:23:29 +03:00
Andrew Borodin
dc604d811a The check result of g_new(), g_new0(), g_malloc(), g_malloc0() and g_realloc() is useless.
g_new(), g_new0(), g_malloc(), g_malloc0() and g_realloc() functions
never return NULL and call abort() on fail. So check result of these
functions is useless. g_try_new(), g_try_new0(), g_try_malloc(),
g_try_malloc0() and g_try_realloc() functions are used instead.

Some minor optimization and code formatting are also performed.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-16 11:10:43 +02:00
Andrew Borodin
1aee8632ef Remove declaration of unused function.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-16 11:10:43 +02:00
Vit Rosin
80d474fdfa rearranging some lines in src_skin_colors.c mc_skin_color_parse_ini_file()
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-12-16 11:10:43 +02:00
Vit Rosin
a7110419a6 missing check in src_mcconfig_get.c-mc_config_get_groups()_-2
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-12-16 11:10:43 +02:00
Vit Rosin
b6875454b2 Unifying of g_strconcat() calls
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-16 11:10:43 +02:00
Andrew Borodin
718c91e955 Fixed i18n of file operation dialog titles.
Also type accuracy.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-16 11:10:42 +02:00
Andrew Borodin
4ef67c33b9 No need to call done_menu() at MC exit.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-16 11:10:42 +02:00
Andrew Borodin
1e32a51d2d Optimization of DLG_RESIZE message handling.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-16 11:10:42 +02:00
Sergei Trofimovich
66371454c7 doxygen: various warning fixes
Fixes such warnings:
mc/src/viewer/mcviewer.h:1: Warning: the name `view.h' supplied as the second argument
                            in the \file statement is not an input file
mc/vfs/vfs.c:267: Warning: explicit link request to 'op' could not be resolved
mc/src/strescape.c:219: Warning: Found unknown command `\params'
mc/src/strescape.c:153: Warning: Found unknown command `\params'
mc/src/strescape.c:187: Warning: Found unknown command `\params'
mc/src/strescape.c:219: Warning: Found unknown command `\params'
mc/src/strescape.c:153: Warning: Found unknown command `\params'
mc/src/strescape.c:187: Warning: Found unknown command `\params'
mc/vfs/fish.c:33: Warning: explicit link request to 'sh' could not be resolved
mc/vfs/fish.c:33: Warning: Found unknown command `\host'
mc/vfs/ftpfs.c:43: Warning: Found unknown command `\hobit'
mc/vfs/sfs.c:26: Warning: explicit link request to 'ugz' could not be resolved
mc/vfs/vfs.c:267: Warning: explicit link request to 'op' could not be resolved
mc/vfs/vfs.c:267: Warning: explicit link request to 'op' could not be resolved

Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
2009-12-16 11:10:42 +02:00
Andrew Borodin
d3e91b0711 Fixed forgotten call of va_end() in mc_log().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-16 11:10:41 +02:00
Andrew Borodin
34e6b6c036 src/boxes.c (configure_vfs): fixed #ifdef directive.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-16 11:10:41 +02:00
Sergei Trofimovich
981c19b651 fix formatarg: pass ll instead of passing off_t as "%lld" parameter
Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
2009-12-16 11:10:41 +02:00
Sergei Trofimovich
4f2079fec7 clang: fixed useful warnings (-Wformat related)
../../mc/edit/editcmd.c:2519:50: error: field precision should have type 'int', but argument has type 'gsize' (aka 'unsigned long') [-Wformat]
    match_expr = g_strdup_printf ("(^|\\s+|\\b)%.*s[^\\s\\.=\\+\\[\\]\\(\\)\\,\\;\\:\\\"\\'\\-\\?\\/\\|\\\\\\{\\}\\*\\&\\^\\%%\\$#@\\!]+", word_len, bufpos);
                                                 ^                                                                                         ~~~~~~~~
../../mc/edit/editcmd.c:2700:38: error: field precision should have type 'int', but argument has type 'gsize' (aka 'unsigned long') [-Wformat]
    match_expr = g_strdup_printf ("%.*s", word_len, bufpos);
                                     ^    ~~~~~~~~
2 diagnostics generated.
make[2]: *** [editcmd.o] Error 1
make[2]: Target `all' not remade because of errors.
../../../mc/src/mcconfig/common.c:71:74: error: format string is not a string literal (potentially insecure) [-Wformat-security]
        g_propagate_error (error, g_error_new (mc_main_error_quark() ,0, strerror(errno)));
                                                                         ^~~~~~~~~~~~~~~
../../../mc/src/mcconfig/common.c:83:74: error: format string is not a string literal (potentially insecure) [-Wformat-security]
        g_propagate_error (error, g_error_new (mc_main_error_quark() ,0, strerror(errno)));
                                                                         ^~~~~~~~~~~~~~~
2 diagnostics generated.
make[3]: *** [libmcconfig_la-common.lo] Error 1
make[3]: Target `all' not remade because of errors.
../../mc/src/main.c:2165:41: error: format string is not a string literal (potentially insecure) [-Wformat-security]
        message (D_ERROR, _("Warning"), error->message);
                                        ^~~~~~~~~~~~~~
1 diagnostic generated.

Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
2009-12-16 11:10:41 +02:00
Andrew Borodin
c57bdc79ba Fixed typo.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-16 11:10:40 +02:00
Oswald Buddenhagen
4bc224dd3c Ticket #1845: Code cleanup before 4.7.0 release.
Little optimization for src/filehighlight/get-color.c:c_fhl_is_stale_link() function.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-12-16 11:10:15 +02:00
Enrico Weigelt, metux IT service
d579bb7877 Ticket #1789: Removed obsolete checks for setuid(), getuid(), etc
Removed obsolete checks for setuid(), getuid(), etc

Signed-off-by: Enrico Weigelt <weigelt@metux.de>
2009-12-15 18:13:40 +03:00
Andrew Borodin
bc82403d07 Ticket #1536: fix of case insensitive file sorting in UTF-8 locales.
In UTF-8 locales, with case sensitive sort files are sorted properly:

00050.jpg
001-gepard.jpg
0175ep.jpg
027.jpg
060912.jpg
win.jpg
z1.jpg

but if in case insensitive sort, they get mixed up
and files with number in their name are sorted badly:

001-gepard.jpg
027.jpg
00050.jpg
0175ep.jpg
060912.jpg
win.jpg
z1.jpg

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-09 20:12:17 +03:00
Slava Zanko
2887d5c710 Ticket #1858: Segmentation fault when search in different encodings
Test case:
1. Make two files with same content but with different encodings (for example, in UTF-8 and KOI8-R);
2. Open UTF-8 file for editing. Press Alt+e and set 'UTF-8' encoding;
3. Search someting
4. exit from editor and open file with 'KOI8-R' encoding;
5. You must see a dots. Now press shift+F7 (continue search);
6. Segfault here

Fix issue:
Now function mc_search__recode_str() returns newly allocated string in any case

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-12-07 13:45:25 +02:00
Slava Zanko
9808eed46a Minor fix for mc_log_mark() macro.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-12-02 16:05:26 +02:00
Slava Zanko
c9978ff155 Ticket #1798: Not enough magic read before checking for lzma files
In the function get_compression_type() in src/util.c, only 5 bytes of the
file are read into the magic array, but the test for lzma files checks the
first 6 bytes in the magic array.

Fix issue:
now reads 6 bytes for correct recognize LZMA-files.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-12-02 16:03:07 +02:00
Andrew Borodin
92291381e3 Ticket #1781: array index is out of bounds.
Fixed array index in sort_key_name_conv_tab() function.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-12-02 10:01:01 +03:00
Stan. S. Krupoderov
c1426b90ff Ticket #407: C-w does not delete whole command line
Fix set mark on delete_region

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-12-01 16:24:43 +02:00
Andrew Borodin
e6851b18b3 Ticket #1781: little speedup of startup.
Keys sort functions have been maken inline.
Decrease of memory usage: reimplemented
key_name_conv_tab_sorted array as array of pointers
instead of entire copy of key_name_conv_tab array.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-23 21:30:43 +03:00
Andrew Borodin
35de934437 Ticket #1814: allow save empty value in history.
Problem: 'Find File' dialog doesn't save an empty "content" filed on exit.
Proposed solution: allow each history (not in content in 'Find File' dialog
only) save an empty value.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-20 19:44:14 +03:00
Leonid Myravyev
c3279bd980 Ticket #1835: Coding style fixups in src/charset.c
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-11-20 14:13:12 +02:00
Andrew Borodin
0d4ebe6ece Ticket #1836: fixed wrong shortcuts in menu items.
Also minor optimization of key names sort.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-20 14:48:48 +03:00
Andrew Borodin
a193e2e56f Ticket #1831: fixed compilation warings of --disable-nls and --disable-charset options.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-11-20 14:39:51 +03:00
Slava Zanko
59efad629f Ticket #1613: remove charset confirmation on startup
Since mc-4.7.0-pre1 was added charset confirmation if charset was changed.

This commit was adds automatic recognize of system charset and fix in current
config. Also, now contig file will untouched if 'Auto save setup' option is switched off.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-11-19 10:36:37 +02:00
Andrew Borodin
ed2e33574a Fixed generation of shortcut string for menu items.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:52 +03:00
Andrew Borodin
5e68b69020 Many shortcuts were fixed.
Ticket #1764:
  * fxed shortcuts for select/unselect/reverse selection
of file group;
  * removed 'C-x C-c' default shortcut for Quit command.

Also fixed some emacs-like keybindings for editor and viewer.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Vit Rosin
d8130a82a3 Ticket #1824: fixed some keybinding names
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
1ed7892f8e Modified ButtonBar engine to allow bind keys to unused buttons.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
eb2e4b0e17 Unified some commands that differ in its behaviour when called via menu or shortcuts.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
e252488ac2 Added Esc key to the key name table.
Also some fixes of DLG_ACTION message handling in panels and viewer.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
c2693b7212 Implemented keybindings engine for ButtonBar (F1-F10 keys).
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
b7f367542a Modified menu command handling using DLG_ACTION message.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
11d21f1437 Modified dialog callback function.
Added two parameters:
  * Widget *sender -- to recognize the wiget that have sent message;
  * void *data -- to pass any user-defined data to the dialog.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
ccabd60ffc Implemented keybindings for Help window.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
5592a472f6 Optimization of command handling. 2009-11-19 10:07:51 +03:00
Andrew Borodin
e85f6b23e3 Added Viewer commands and shortcuts.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
8224a26cf4 ButtonBar optimizations.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
6b71dc9f12 Added missed shortcuts for ButtonBar commands.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
da33e767e9 Type accuracy and code clean up.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
9760092c17 Enlarged sizes of Directory Tree dialog window.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
efdb645468 Implemeted keybindings for Tree widget
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
9b82c05fca Changed widget order in editor and viewer dialogs.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
e3f85ff6d0 Refactoring of ButtonBar drawing in viewer.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
ce4334e51e Made mcview_execute_cmd() function matched with dlg_exec_fn type.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Andrew Borodin
71c9e4c668 Ticket #212: implemented keybindings for ButtonBar.
First step: renamed type of dialog command execution function.
Made execution function more flexible: added parameters for
sender and receiver widgets and user data.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-19 10:07:51 +03:00
Enrico Weigelt, metux IT service
d06eb6452e Ticket #1826: fixing build w/o internal edit 2009-11-18 22:44:20 +02:00
Slava Zanko
e071af460f Ticket #1794: Segfault in treeview
Testase:
 * rm -f ~/.mc/Tree
 * run mc
 * F9 -> Command -> Directory tree
 * Press F2
 * Go to '/lib' item
 * Press F2
 * exit from mc
 * run mc again
 * F9 -> Command -> Directory tree
 * press HOME key

Fix issue:
changed forgotten variable name.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-11-18 22:36:56 +02:00
Andrew Borodin
15a21a71cd Ticket #1781: some improvements of startup time.
After implementation of keybinding engine and reimplenetation
of menu engine, MC starts very slow due to multiple trivial
(totally non optimized) search of many values in many arrays.

This patch performes the some speedup of MC startup process.

Statistics:
- startup time without the patch: 0m0.413s
- startup time with the patch: 0m0.073s

Great thanks to 0xe2.0x9a.0x9b for the original patch.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-18 14:23:48 +03:00
kenny
0c309724a5 Ticket #1776: save flags of select/unselet file group.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-18 14:21:08 +03:00
Vit Rosin
aa3f4b66d4 Ticket #1803: added missed esc sequencies for qansi terminals.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-18 13:27:20 +03:00
Egmont Koblinger
ecee0cd4b9 Ticket #256 (segfault in backward_word)
fixed segfault in backward_word (widget.c)
    ...
    The for loop, whose purpose is to remove exactly 1 character
    (hence I don't get why it's a loop, but nevermind) was not UTF8-ready.
    So if the character preceding the cursor was an accented one,
    it jumped to the middle of the UTF-8 sequence, causing the rest of
    the stuff go unpredictable.

    Although it *should* never happen (which, as we all know,
    does not equal to "never happens"), in this case "p" simply jumped
    over "in->buffer". The function has a "p != in->buffer" check three times,
    it might it more robust if you replaced that with "p >= in->buffer".
    This should prevent the segfault, and just stay with a slightly buggy but
    otherwise harmless alt-backspace behavior, should there be any UTF-8 or
    similar bugs left. This change is not included in my patch.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-11-18 11:41:12 +03:00
Slava Zanko
7bdff35062 Makefile.am: Fixed incorrect variable name if maintainer mode is active.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-11-11 11:33:06 +02:00
Slava Zanko
90a7ad8528 Ticket #1790: mc crashes on start
If ~/.mc/panels.ini have incorrect value of 'sort_order' key, then mc will crashed.

Fix issue: Now default sort_order for incorrect value is  'name' (sort by name)

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-11-11 11:33:06 +02:00
Enrico Weigelt, metux IT service
9070aa11f7 Fixed several missing includes 2009-11-09 13:49:57 +01:00
Enrico Weigelt, metux IT service
ae417890fe src/screen.c: const char* cleanup, fixing break on -Werror 2009-11-09 13:49:56 +01:00
Enrico Weigelt, metux IT service
91a5df442f Dropping non-strftime() support and fixing -Werror problem
Problem:

a) when running ./configure, strftime() and other functions cannot be
   properly detected, since autoconf generates crappy test code, which
   at least fails when warnings are treated as errors (gcc: -Werror).

b) strtime() is standard since C89, so we can simply expect it to exists
   (if there's *really* some acient box out there breaking mc build,
   it's libc/toolchain should be fixed ;-p)

Solution:

Remove the checks for strftime() and all workarounds
2009-11-09 13:49:56 +01:00
Andrew Borodin
dc2989d766 Display ATime, MTime and CTime for ".." in file panel.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-09 13:08:38 +03:00
Andrew Borodin
b39b23a627 Fixed display info about ".." directory in Info panel.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-09 13:08:38 +03:00
Andrew Borodin
7ce24c2f57 Set correct stat info for ".." directory.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-09 13:08:38 +03:00
Andrew Borodin
4092bf54ac Ticket #1757: set actual stat info for ".." directory in panel.
1st step: minor refacoring.
Removed call of intermediate function and changed the retun value type.
Type accuracy.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-11-09 13:08:38 +03:00
Sergey Fionov
2244f5c2c5 Avoid Sun Studio compiler bug
Modify designators to avoid bug #6888373
(http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6888373)

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-11-04 17:30:31 +02:00
Martin Petricek
2cfed22012 Ticket #1746: Setting "Use passive mode over proxy" is not remembered
Fix: "Use passive mode over proxy" was not remembered in config

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-11-03 12:20:42 +02:00
Slava Zanko
51f10b3038 Cleanup of code for compile with new warnings options for compilator
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-30 20:36:48 +02:00
Slava Zanko
a5fa537f2e Added macros for simplest debug process (yes, gdb is a better way)
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-30 20:36:48 +02:00
Slava Zanko
5441d89264 Reorganization of src/Makefile.am
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-30 20:36:41 +02:00
Slava Zanko
2a4075d246 Now possible to compile mc in different cases: as mc maintainer or as end-user.
Some debug-related code will compile just in mainteiner mode.
Also, added new parameter for configure script: --enable-werror

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-30 20:36:15 +02:00
Andrew Borodin
91a4598b54 Ticket #1755: code cleanup before 4.7.0-pre4 release.
Free some variables allocated at MC startup.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-30 14:41:03 +02:00
Slava Zanko
12ed4d0b45 Ticket #1753: panel: bad mounpoint is no longer 'red' highlighted
Restored behavior with stale mountpoint (now handled as stale link).

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-29 16:48:51 +02:00
Ilia Maslakov
478328812f Ticket #244
add shared clipboard support

Signed-off-by: Ilia Maslakov <il.smind@google.com>

    Fixed memory leaks. Type accuracy. Optimization.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>

    * fixed ctrl-g handler
    * change action names from InputKillSave to InputXStore and InputPaste to InputXPaste
    * update mc.keymap.default mc.keymap.emacs

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-10-29 12:18:18 +00:00
Ilia Maslakov
359c9406d1 Ticket #1489 (indent block)
added bindings for shift block 'EditShiftBlockLeft', 'EditShiftBlockRight'
    EditShiftBlockLeft, EditShiftBlockRight - force move block without option_persistent_selections checking

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-10-29 07:58:30 +00:00
Ilia Maslakov
a16b37c8e7 Ticket #1736: editor: X copy/paste eats newlines
1. Open empty file (<Shift-F4>)
2. Fill with data:

1234
5678
9abc

3. Mark contents (or any multiline text in, for example, firefox) with mouse (<Shift+MouseDown???>)
4. Insert somewhere below third line (<Shift+Insert>)
5. Newlines are eaten (xterm)

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-29 09:46:20 +02:00
Ilia Maslakov
91c7dbb71c Ticket #1724 (forgotten hotkeys)
* fixed binding in mc.keymap.default and mc.keymap.emacs
    for CmdCopyCurrentTagged, CmdCopyOtherTagged,
    CmdCopyCurrentPathname, CmdCopyOtherPathname
    * fixed typo

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-10-29 06:23:51 +00:00
Slava Zanko
b62aece7eb Fixed width calculation of Buttonbar widget.
Also Labels on buttonbar aligned to left side.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-29 00:00:26 +02:00
Slava Zanko
742eae18d2 Ticket #1703: SKIN: Make own colorpairs for buttonbar widget
Now buttonbar have own colorpairs:

[buttonbar]
    hotkey=red;black
    button=yellow;cyan

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-28 17:50:46 +02:00
Ilia Maslakov
d98e14de49 Ticket #1600 (incorrect drawing hint)
drop "LANGUAGE" from checking locale.

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
2009-10-28 12:17:02 +00:00
Slava Zanko
9c284e99c2 Fix segfault in charset confirmation dialog at start of mc.
When config files is unaccesible, doalig was crashed after 'Esc' pressing.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-28 13:37:40 +02:00
Slava Zanko
e7c6d59e63 Code cleanup for compile with new CFLAGS value.
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-28 13:37:40 +02:00
Slava Zanko
c9b4b0159d Ticket #1656: Incorrect processing of cases the lack of rights to save preferences.
In the case where insufficient rights to the contents of the directory ~/.mc/* to
save preferences I get "settings saved in ~ /.mc/ini", but really nothing is saved.

It would be correct to issue a message like "Not enough permissions to save the ~/.mc/ini"

Also, when autosave should be issued a message about the lack of rights.

This branch will check rights of config-files.

testCase:
 *) chmod 0400 ~/.mc
 *) run mc

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-28 13:37:39 +02:00
Andrew Borodin
00e267c2e0 Sync argument name of mcview_viewer() function in header and in source files.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-28 14:31:38 +03:00
Andrew Borodin
3d1114652f Ticket #1750: fix of view next/prev file in viewer.
To view the next (C-f) of previous (C-f) file in viewer,
the quit from viewer is required now.
This commit restores the previous behavior.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2009-10-28 14:31:38 +03:00
Slava Zanko
575f996e0d Ticket #1748: lzma archives with .tlz extention are not recognized as archives
Attempting to open a .tlz lzma archive fails - error 'xxx.tlz doesn't look like a tar archive'.
If the file is renamed to .tar.lzma, it is opened without problems.

Fix issue: add recognize of '.tlz' extention.

Refactoring: avoid calls of strlen() function

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-28 13:00:37 +02:00
Alexander Moiseenko
936727622d Fixed problems:
* When try to replace existing file in background operation
  assertion raised (created operations for initialization ctx->ui for background):
  ** (mc:25716): CRITICAL **: file_progress_real_query_replace: assertion `ctx->ui != NULL' failed

 * Process has been already done, but still draw in list (C-x j)

 * Process is stopped or worked, remove operation don't hide process from list, but kill it

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-28 12:05:07 +02:00
Alexander Moiseenko
81f5b5e0b8 Ticket #1500: Segmentation fault while background copying
Test case:
 * create file with name "test" in "tmp" directory (for example)
 * create directory with same name ("test") in other "tmp2" directory (for example)
 * try to copy or move file "test" into "tmp2" in background mode
 * wait for some time

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-28 12:05:06 +02:00
sfionov
1551db2f9f Ticket #1642: filegui.c contains Linux-specific things
mc 4.7.0-pre1 introduced dynamic "Save attributes" checkbox value in Copy/Move dialog.
But code is Linux-specific, and not even isolated by macros.

I suggest to add code specific for BSD and SVR4 systems.

In BSD systems (MacOS X, NetBSD, FreeBSD) there is statfs.f_fstypename which contains name of filesystem.
Valid FS names are: msdos, msdosfs (FreeBSD), ntfs, smbfs, procfs, fusefs (BSD), fusefs_subfstype (Mac)

In SVR4 systems (Solaris and other SVR4 Unixes) there are statvfs.f_basetype and statvfs
syscall instead of statfs and also autotools define STAT_STATVFS.
Valid FS names are: pcfs, proc, ntfs, fuse, smbfs

(Note that NetBSD 3.0+ also use statvfs but with BSD syntax.)

For all other OSes we simply return 1.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-28 10:38:20 +02:00
Slava Zanko
27cc9ac15e Ticket #119: Persistent global configuration option for "Preserve attributes" wanted
Currently, there is no way to change the defaults. The file mask
dialog options are not persistent.

Added new config option 'copymove_persistent_attr'. If this option is equal to '0'
then 'Preserve attributes' in copy/move dialog will always switched off.

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
2009-10-27 23:20:48 +02:00