Commit Graph

1411 Commits

Author SHA1 Message Date
Pavel Roskin
d2c8d076f9 * view.c (init_growing_view): Avoid reporting the same error
twice.  Reported by Moritz Barsnick <moritz@barsnick.net>
2002-09-08 15:22:28 +00:00
Pavel Roskin
9deca156f0 * textconf.c: Don't use SLANG_TERMINFO, which is unused anywhere
else.  Assume that terminfo is used if USE_TERMCAP is undefined.
2002-09-07 07:36:59 +00:00
Pavel Roskin
7d723361b2 * subshell.c (subshell_name_quote): Return NULL if we are out of
memory.  Use "echo -e" with zsh (Debian bug #150996).
(do_subshell_chdir): Be prepared to get NULL from
subshell_name_quote().
2002-09-07 00:27:53 +00:00
Pavel Roskin
53982cb546 * profile.c: Remove unused code. Eliminate global variables.
(is_loaded): Rename to find_loaded().  return matching profile.
Adjust all dependencies.
2002-09-06 20:25:15 +00:00
Pavel Roskin
ca90bd204f * fs.h: Only redefine S_IS* macros if they are undefined, and
then define them to 0.  S_IF* constants should be avoided.
* util.c : Whenever possible, use standard POSIX macros to test
for the file type.
Reported by Andrew V. Samoilov <sav@bcs.zp.ua>
2002-09-06 19:23:45 +00:00
Pavel Roskin
ff8cf87949 * cmd.c (nice_cd): Fix conditions when this function is
compiled.
2002-09-06 01:30:50 +00:00
Pavel Roskin
a36e7b7fad * fs.h: Replace S_IFFIFO with S_IFIFO, which is the right name. 2002-09-06 00:52:35 +00:00
Pavel Roskin
5e9c0314a2 * fs.h: Correct S_IS* definitions to use S_IFMT. Add fallback
definitions for S_IFDOOR and S_ISDOOR.
* screen.c (string_file_type): Remove unnesessary ifdefs, fs.h
takes care of it.
(file_compute_color): Add support for Solaris doors.
* util.c (string_perm): Remove unnesessary ifdef.
2002-09-06 00:47:46 +00:00
Pavel Roskin
d520b9f76f * man2hlp.c (handle_command): Make clear that unsupported
command is a warning, not an error.  Avoid unsafe strcat().
2002-09-05 20:47:12 +00:00
Pavel Roskin
cac0accb55 * view.c (view_mode_callback): Eliminate, use the default
callback.
2002-09-05 19:16:18 +00:00
Pavel Roskin
87da6b9f42 * main.c (load_hint): Don't hardcode copyright years. Use a
translated message.
2002-09-05 16:36:43 +00:00
Pavel Roskin
01e2780615 * main.c (midnight_callback): Avoid calling the default DLG_DRAW
handler.  From David Martin <dmartina@excite.com>
2002-09-05 06:59:17 +00:00
Pavel Roskin
63a2d3dceb Compile fix. 2002-09-05 06:55:50 +00:00
Pavel Roskin
b248f6bb32 * help.c (help_handle_key): Sanity check for broken help files.
From David Martin <dmartina@excite.com>
2002-09-05 06:51:46 +00:00
Pavel Roskin
206fdf6f1d * global.h: Eliminate xgetch, update all dependencies. 2002-09-03 22:23:27 +00:00
Pavel Roskin
556f733f12 * boxes.c: Fix remaining old-style calls to create_dlg().
* complete.c: Likewise.
* main.c: Likewise.
* view.c: Likewise.
2002-09-03 20:19:22 +00:00
Pavel Roskin
97148e3e55 Reuse the same title "Find File". Reformat most ugly code. 2002-09-03 20:04:54 +00:00
Pavel Roskin
facfea1d40 * wtools.c: Remove Chooser, its unused. 2002-09-03 19:57:13 +00:00
Pavel Roskin
dce476e552 * dlg.c: Fix the case when the dialog has no title. 2002-09-03 19:19:23 +00:00
Pavel Roskin
0d7af2cdba * acinclude.m4: Remove Termnet support, it's too old and obscure
to be supported properly.
2002-09-03 17:58:26 +00:00
Pavel Roskin
2b41a2e4e2 One translatable message less. 2002-09-03 17:46:15 +00:00
Pavel Roskin
77791e773f * wtools.c (real_input_dialog_help): Use a more reliable way
to indicate password input.
2002-09-03 17:36:27 +00:00
Pavel Roskin
f098afae04 * boxes.c (display_widgets) [!HAVE_CHARSET]: Fix initialization.
(vfs_smb_get_authinfo): Reuse another translated string.
2002-09-03 17:30:16 +00:00
Pavel Roskin
09df85b9b7 Reuse other translated strings. 2002-09-03 16:55:05 +00:00
Pavel Roskin
d9c6403250 * wtools.h (QuickDialog): Eliminate the "class" field - it's not
used and it can clash with C++ code.  Adjust all dependencies.
2002-09-03 08:00:02 +00:00
Pavel Roskin
6c2eb32b70 * dlg.c (x_set_dialog_title): Completely eliminate. Adjust all
dependencies.
2002-09-03 07:42:36 +00:00
Pavel Roskin
00baa9f8fe * help.c (interactive_display): Fallback to node "[main]" if the
requested node cannot be found.
2002-09-03 07:22:23 +00:00
Pavel Roskin
afae5939cd * help.c (help_index_cmd): Eliminate unneeded search for
"[Help]", which always fails.  Fix crash if "[Contents]" cannot
be found.  Reuse more generic error message.
2002-09-03 07:15:01 +00:00
Pavel Roskin
52caab36b8 * filegui.c: Eliminate x_set_dialog_title().
* hotlist.c: Likewise.
* help.c: Likewise.
(interactive_display): Default to node "[main]" if the given
node is empty.
2002-09-03 06:53:11 +00:00
Pavel Roskin
69a3777112 * dlg.c (create_dlg): Take title instead of unused name as the
8-th argument.
(x_set_dialog_title): Free old title.  Mark this function
obsolete.
* achown.c: Use new create_dlg().
(do_enter_key): Provide titles for popups.
2002-09-02 19:24:23 +00:00
Pavel Roskin
67cfc5d84d * dlg.c: Remove unused code, make functions static if possible. 2002-09-02 18:42:49 +00:00
Pavel Roskin
6f0c076c65 * chmod.c: Use common_dialog_repaint().
* chown.c: Likewise.
* layout.c: Likewise.
* option.c: Likewise.
2002-09-02 18:03:15 +00:00
Pavel Roskin
e000c69683 * wtools.c (common_dialog_callback): Fold into ...
* dlg.c (default_dlg_callback): ... this.  Don't redraw dialogs
that don't have colors.  Adjust all dependencies.
(std_callback): Elimitate.
2002-09-02 16:31:33 +00:00
Pavel Roskin
7e0d162f5e * panelize.c (panelize_refresh): Eliminate in favor of
common_dialog_callback().
2002-09-02 08:22:50 +00:00
Pavel Roskin
0df513bcc2 * widget.c (history_callback): Eliminate in favor of
common_dialog_callback().
(show_hist): Set dialog title and flag DLG_COMPACT.
2002-09-02 08:01:35 +00:00
Pavel Roskin
43509ea980 * help.c (help_callback): Use common_dialog_callback().
(interactive_display): Set dialog title.
2002-09-02 07:48:01 +00:00
Pavel Roskin
1e2884e94d * wtools.c (listbox_callback): Eliminate in favor of
common_dialog_callback().
2002-09-02 07:37:15 +00:00
Pavel Roskin
1f478c647a * wtools.c (dialog_repaint): Eliminate, nobody should be using
non-standard colors.  Adjust all dependencies.
(common_dialog_repaint): Fix return code.
(query_callback): Eliminate, use common_dialog_callback()
instead.
2002-09-02 07:31:19 +00:00
Pavel Roskin
812e80c85a Add a comment saying where the code is broken and why. 2002-09-02 07:18:51 +00:00
Pavel Roskin
cec127c569 * listmode.c (listmode_refresh): Use common_dialog_repaint().
Eliminate all global variables.  Reformat the whole file.
2002-09-02 06:06:49 +00:00
Pavel Roskin
946e09abc2 * boxes.c (init_disp_bits_box): Use common_dialog_callback().
Return the new dialog.
2002-09-02 05:32:14 +00:00
Pavel Roskin
9f5b82fe08 * boxes.c (display_callback): Use common_dialog_repaint().
(display_init): Avoid using two different translations.
2002-09-02 05:09:45 +00:00
Pavel Roskin
03e1f0638e * help.c (interactive_display): Don't reuse the old value of
help_lines - LINES could have changed.  Scale height better for
terminals with many lines - use 2/3 of the full screen.
2002-09-02 02:40:22 +00:00
Pavel Roskin
e1aee61843 * man2hlp.c: Move handling of .SH and NODE to a separate
function handle_node().  Don't output empty nodes except in the
table of contents.
2002-09-02 02:06:44 +00:00
Andrew V. Samoilov
64605f4785 * man2hlp.c (handle_command): Handle .SM and .SB. 2002-09-01 16:54:11 +00:00
Andrew V. Samoilov
cd9e02c125 * man2hlp.c (print_error): Print input filename.
(handle_command): Handle .P, .LP, .IP and .br.
Ignore comments and .TH (Title header).
Report about unsupported commands.
2002-09-01 10:45:35 +00:00
Andrew V. Samoilov
7d821e954e * user.c (debug_out): Use "%s" as text argument. 2002-09-01 08:10:11 +00:00
Andrew V. Samoilov
ab44f618f9 * win.c (key_name_conv_tab): Fix initialization. 2002-09-01 07:42:54 +00:00
Andrew V. Samoilov
17a8ca0706 * ext.c (regex_command): Use "%s" as text argument. 2002-09-01 07:38:24 +00:00
Andrew V. Samoilov
dd3e9e07c6 * ext.c (regex_command): Use "ChangeLog" as text argument. 2002-09-01 07:38:24 +00:00
Pavel Roskin
74c4b19546 * help.c (show): Fix segfault on unterminated help files.
From David Martin <dmartina@excite.com>
2002-08-31 14:20:14 +00:00
Pavel Roskin
517e1cf8e7 * key.c (get_event): Reduce scope of select_set. Don't check
mouse_enabled all the time, instead break out of the loop if it
becomes 0.
2002-08-31 06:40:47 +00:00
Pavel Roskin
66f37c0af4 * main.c (do_nc): Make midnight_colors[] local to do_nc().
Initialize normal color - it's used by the tree.
* boxes.c (tree_box): Use standard dialog_colors.
* tree.c: Use NORMALC for normal entries.
2002-08-31 05:50:06 +00:00
Pavel Roskin
68f0b4b8b4 * view.c (view): Avoid passing an uninitialized color array to
create_dlg() - pass NULL instead.
2002-08-31 04:30:57 +00:00
Pavel Roskin
8eb26481c1 Missed "const" for query_colors in the last commit. 2002-08-31 00:31:14 +00:00
Pavel Roskin
180ec10d69 * color.c: Define global array alarm_colors for the colors used
in the dialogs that should be most visible (error messages,
request to delete or overwrite).
(load_dialog_colors): Initialize alarm_colors.
* filegui.c: Use alarm_colors.
* wtools.c: Likewise.
* dlg.c (create_dlg): Make the color_set array constant.
2002-08-31 00:29:48 +00:00
Pavel Roskin
485a8cbac1 * wtools.c (common_dialog_repaint): Use colors specific to the
current dialog, not fixed colors for "normal" dialogs.
* filegui.c (replace_callback): Eliminate, use
common_dialog_callback() instead.
2002-08-30 23:48:38 +00:00
Pavel Roskin
947a8c8c1b * filegui.c (file_op_context_create_ui): Use
common_dialog_callback().  Set title to the operation name.
(op_win_callback): Remove, it's unused.
2002-08-30 23:32:59 +00:00
Pavel Roskin
f8996f5846 * view.c: Make static whatever possible.
* view.h: Remove internal view routines.
2002-08-27 19:10:54 +00:00
Andrew V. Samoilov
3f03b46b8d * selcodepage.c (select_charset): Use snprintf instead of sprintf.
(do_select_codepage) [!HAVE_ICONV]: Remove.
2002-08-27 13:23:29 +00:00
Andrew V. Samoilov
6407a05869 * man2hlp.c (fopen_check): Fix buffer overflow on error 2002-08-27 10:39:09 +00:00
Pavel Roskin
d467cf4003 Update. 2002-08-27 07:25:27 +00:00
Pavel Roskin
9514de4ed7 * charsets.c: Add disclaimer of warranty.
* filenot.c: Likewise.
* fileopctx.c: Likewise.
* mfmt.c: Likewise.
* selcodepage.c: Likewise.
* text.c: Likewise.
* textconf.c: Likewise.
2002-08-27 05:27:11 +00:00
Pavel Roskin
3c57e07af3 * man2hlp.c (main): Factor error checks in fopen() and fclose(),
eliminate reuse of variables for different purposes, add more
comments.  Correctly process "&" escape.
The last part is from David Martin <dmartina@excite.com>
2002-08-27 04:27:26 +00:00
Pavel Roskin
2adae11aa4 * main.c (init_xterm_support): Force xterm-style screen saving
and no mouse on "cygwin" terminal.
2002-08-26 15:26:38 +00:00
Pavel Roskin
488f4c3e44 * man2hlp.c: Change default from the English string for TOPICS,
to no heading.
2002-08-25 18:40:33 +00:00
Pavel Roskin
f9a0f1440a * man2hlp.c (handle_command): Remove quotes from TOPIC. 2002-08-25 18:13:37 +00:00
Pavel Roskin
8ade32d7d9 * key.c (get_event): Check gpm_fd before using it in FD_SET. If
gpm_fd is -1 (gpm has died), disable mouse support.
2002-08-25 05:47:47 +00:00
Pavel Roskin
60f9328e8d * key.c: Use the maximal file descriptor, not FD_SETSIZE in all
calls to select().
* subshell.c: Likewise.
2002-08-25 05:44:57 +00:00
Pavel Roskin
f5a762b7a8 * user.c (expand_format): Remove support for error file in the
editor.
* utilunix.c (close_error_pipe): Fix the condition when nothing
needs to be dislayed.
2002-08-24 17:25:27 +00:00
Pavel Roskin
3982497692 * dlg.c (x_set_dialog_title): Force uniform spacing.
From Andrew Borodin <borodin@zarya-k.ru>
2002-08-24 16:10:26 +00:00
Pavel Roskin
40136e5f74 * utilunix.c (check_error_pipe): Check error_pipe[0], not
stdout.  From Pavel Tsekov <ptsekov@gmx.net>
2002-08-24 16:03:23 +00:00
Pavel Roskin
9066ce18c0 * achown.c (chown_refresh): Use common_dialog_repaint(). 2002-08-24 06:11:54 +00:00
Pavel Roskin
27978d1b55 * dlg.h (struct Dlg_head): Separate user flags and internal
flags.  Make "direction" a user flag.  Adjust all dependencies.
* dlg.c (run_dlg): Return ret_value.
2002-08-24 04:51:09 +00:00
Pavel Roskin
45864c19ed * text.c (default_edition_colors): Use more rxvt-friendly color
for dhotnormal.
2002-08-23 22:14:03 +00:00
Pavel Roskin
214358fb02 * configure.in: Make GLIB_LIBS a separate AC_SUBST'ed variable,
use only for the programs that need it (mc and mcserv).
2002-08-23 21:02:42 +00:00
Pavel Roskin
96087a4179 * Makefile.am: Remove definition of CONFDIR, it's not used. 2002-08-23 20:49:44 +00:00
Pavel Roskin
9feb2ffdf5 * layout.c (print_vfs_message): Set normal color, don't use
random current attributes.
2002-08-22 23:59:20 +00:00
Pavel Roskin
c3e1cd0a98 * dlg.h (struct Dlg_head): Eliminate "data" field, it duplicated
functionality of "title".
* wtools.c (query_callback): Use dialog_repaint().
(quick_callback): Use common_dialog_repaint().
2002-08-22 23:31:35 +00:00
Pavel Roskin
5a7226fc59 * learn.c (learn_callback): Use common_dialog_repaint().
* achown.c (chl_callback): Likewise.
2002-08-22 23:01:08 +00:00
Pavel Roskin
6810d3211e * dialog.h: Cleanup unused functions.
* dialog.c: Cleanup unused headers.
2002-08-22 22:53:02 +00:00
Pavel Roskin
8aa61fffa3 * dlg.h (struct Dlg_head): Fold fields "raw" and "has_menubar"
into one field "flags".  Adjust all dependencies.  Add new flag
DLG_COMPACT.
* wtools.c (dialog_repaint): Draw frame without spaces if
DLG_COMPACT flag is set.
* complete.c (complete_engine): Set DLG_COMPACT.
(query_callback): Use common_dialog_repaint().
2002-08-22 15:34:25 +00:00
Andrew V. Samoilov
4cce966476 * textconf.c (features) [USE_VFS]: Add cpiofs.
[USE_VFS && USE_NETCODE]: Add fish.
2002-08-22 07:31:08 +00:00
Pavel Roskin
1d2d88c2b9 * keys.h: Remove, include ...
* myslang.h: ... here.
* Makefile.am: Remove keys.h.
2002-08-22 06:56:35 +00:00
Pavel Roskin
089a5523fd * dlg.h: Remove unused fields in struct Dlg_head.
* dlg.c: Adjust for the above.
2002-08-22 05:15:47 +00:00
Pavel Roskin
9803d2ea90 * dlg.h: Remove unused fields in struct Widget.
* dlg.c: Adjust for the above.
* layout.c: Likewise.
2002-08-22 00:50:24 +00:00
Pavel Roskin
83b5c737aa * cmd.c (info_cmd_no_menu): Toggle info screen.
(quick_cmd_no_menu): Toggle quick view.
2002-08-22 00:27:14 +00:00
Pavel Roskin
1f423be341 * help.c (interactive_display): Always show button bar. 2002-08-21 23:02:19 +00:00
Pavel Roskin
f871fca140 * widget.c (buttonbar_callback): Fix a bug that prevented the
last byte from being redrawn.
Reported by David Martin <dmartina@excite.com>
2002-08-21 22:52:29 +00:00
Pavel Roskin
564dc4264b * layout.c (setup_panels): Make the button bar 0 lines high if
it's invisible, so that mouse click on the history button works
with invisible button bar.
2002-08-21 22:27:52 +00:00
Pavel Roskin
2f9416892a * widget.c: Make more functions static. 2002-08-21 21:47:29 +00:00
Pavel Roskin
a29ebd7987 * ext.c: (regex_check_type): Further split. Restore caching
broken in the previous commit.
2002-08-21 19:22:32 +00:00
Pavel Roskin
fdebf03b34 * ext.c (regex_command): Separate checking for "type/" into ...
(regex_check_type): ... this.
2002-08-21 16:24:17 +00:00
Pavel Roskin
9e36fa257d * global.h: Move include for rx.h and eregex.h here. 2002-08-21 07:20:39 +00:00
Pavel Roskin
e7482bec93 * learn.c (learn_button): Don't allow Tab to be learned. 2002-08-21 06:50:09 +00:00
Pavel Roskin
608d74abda * menu.c (create_menu): Get help node as an argument.
* main.c: Use new create_menu() interface.
2002-08-20 21:30:06 +00:00
Pavel Roskin
fdd975af3a Missing return after perror(). 2002-08-20 16:14:48 +00:00
Pavel Roskin
f486423122 * man2hlp.c: Don't redirect stdout. Check result of ftell.
Drop support for invocation with 2 arguments.
2002-08-20 16:13:13 +00:00
Pavel Roskin
2af1e85990 * cons.handler.c (handle_console): Use _exit(), not exit() in
the child.
2002-08-20 00:04:49 +00:00
Pavel Roskin
2c8f2419e5 * main.c (handle_args): Set POPT_CONTEXT_NO_EXEC flag for
poptGetContext().
* popt.c: Call abort() in execCommand() - we should not execute
anything here.
2002-08-20 00:01:33 +00:00
Pavel Roskin
9860f07fc9 * util.h: Remove unused and dangerous flags for my_system():
EXECUTE_TEMPFILE, EXECUTE_SETUID and EXECUTE_WAIT.
* utilunix.c: Corresponding adjustments.
* ext.c: Don't use EXECUTE_TEMPFILE, it has no effect.
2002-08-19 23:41:21 +00:00
Pavel Roskin
d1e02fba0f * subshell.c (synchronize): Workaround for Cygwin (should not be
needed for the next version) - remove SIGCHLD blocking from
old_mask.
2002-08-19 22:28:00 +00:00
Pavel Roskin
047a7f906e * dlg.h: Remove all unused flags for create_dlg(). Adjust all
dependencies.
2002-08-19 06:22:32 +00:00
Pavel Roskin
342b4bbd0f * cmd.c (fishlink_cmd): Implement user interface for FiSH.
* main.c: Add it to the menu.
2002-08-19 06:06:09 +00:00
Pavel Roskin
e29d69423a * help.c (help_follow_link): Made static. 2002-08-19 05:00:58 +00:00
Pavel Roskin
11bd8d9c39 * subshell.c (synchronize): Discard all remaining data from
stdin to the subshell.
2002-08-19 02:06:01 +00:00
Pavel Roskin
105877896d * subshell.c (exit_subshell) [AIX_TCSH_CODE_BELOW_IS_IT_FIXED]:
Remove.  Nobody has fixed this code for years.
2002-08-19 01:54:34 +00:00
Pavel Roskin
6efa4a23f3 * main.h [USE_INTERNAL_EDIT]: Don't include declarations from
edit.h.
* setup.c [USE_INTERNAL_EDIT]: Include edit.h.
2002-08-19 01:43:40 +00:00
Pavel Roskin
96322324ea * boxes.h: Remove user_format.
* boxes.c: Make more variables static, remove all extern
declarations.
* setup.c: Remove some extern declarations.
2002-08-19 01:01:20 +00:00
Pavel Roskin
1e6c5b17ce * mountlist.h: Move some internals ...
* mountlist.c: ... here.
2002-08-19 00:07:08 +00:00
Pavel Roskin
0d89dec899 * main.c: Remove extremely unsafe and poorly designed support
for /tmp/mc.$PID.control file.
* util.c (my_putenv): Remove, it's unused now.
2002-08-18 22:31:49 +00:00
Pavel Roskin
b9421d6927 * panel.h (struct format_e): Make string_fn return const char *.
Adjust all dependencies.
* screen.c (string_file_mtime): Return empty string for "..".
(string_file_atime): Likewise.
(string_file_ctime): Likewise.
2002-08-18 22:01:51 +00:00
Pavel Roskin
05e708a791 * view.c (display): Use enum for boldflag values. Fix cursor
highlighting for the ASCII part of the hex editor.
2002-08-18 20:18:04 +00:00
Pavel Roskin
69f67049fa * layout.c (init_curses) [!HAVE_SLANG]: Add support for
stickchars - fill acs_map[] with ASCII approximations.
* main.c [!HAVE_SLANG]: Enable --stickchars (-a) for ncurses.
2002-08-18 16:34:29 +00:00
Pavel Roskin
d7f635e142 * setup.c: New variable global_profile_name to hold full name of
mc.lib.
(load_setup): Calculate global_profile_name.
(done_setup): Free global_profile_name.
(load_key_defs): Use global_profile_name.
* treestore.c (should_skip_directory): Likewise.
2002-08-17 01:11:21 +00:00
Pavel Roskin
0707cb5278 * man2hlp.c: Implement persistent fread and fwrite to make sure
that all output is read and written.
2002-08-16 16:48:27 +00:00
Andrew V. Samoilov
7b867c0d5c * user.c (expand_format): Cast the argument to functions
for character classification to unsigned int.
(execute_menu_command): Likewise.
2002-08-16 14:56:13 +00:00
Andrew V. Samoilov
fe2fdc4057 * help.c (show): Cast *paint_start to unsigned char to display
Cyryllic with ncurses.
[HAS_ACS_AS_PCCHARS] (acs2pc_table): Make const.
2002-08-16 09:07:20 +00:00
Andrew V. Samoilov
f289243ff2 * help.c (show): Cast *paint_start to unsigned char to display
Cyryllic with ncurses.
[HAS_ACS_AS_PCCHARS] (acs2pc_table): Make const.
2002-08-16 08:55:07 +00:00
Pavel Roskin
479ccc534f * treestore.c (tree_store_remove_entry): Don't use ts.check_name
and don't check it.
2002-08-16 00:05:29 +00:00
Pavel Roskin
cafbb72684 * treestore.c: Remove unused code, reformat.
* treestore.h: Remove unused declarations.
2002-08-15 23:31:23 +00:00
Pavel Roskin
8d173014e9 * fs.h (compute_namelen): New inline function to take care of
the d_namlen field if and only if it's needed.
2002-08-15 19:35:53 +00:00
Pavel Roskin
58da40fa6a * screen.c (string_file_name): Replace non-printable characters
with question marks.
2002-08-15 16:52:51 +00:00
Pavel Roskin
f0dbdeb72e * subshell.c (read_subshell_prompt): Remove argument "how", it's
never set to VISIBLY.  Adjust all dependencies.  Eliminate hack
with "clear_now" - it causes invalid memory access and hides the
real problem.
* util.c (strip_ctrl_codes): Fix possible invalid memory access
if the escape sequence ends unexpectedly.
2002-08-15 06:53:44 +00:00
Pavel Roskin
786c75b683 * dir.c (do_load_dir): Fix leaking of file descriptors - always
call mc_closedir() before return.
2002-08-15 02:02:49 +00:00
Pavel Roskin
66c5184faa Revert undocumented change in the declaration of decompress_extension(). 2002-08-15 01:45:06 +00:00
Pavel Roskin
6d2f235053 * main.c (do_execute) [!HAVE_SUBSHELL_SUPPORT]: Compile fix. 2002-08-15 01:36:09 +00:00
Andrew V. Samoilov
4c25b24536 * util.c (reverse_string): Speed up. 2002-08-14 16:33:50 +00:00
Pavel Roskin
7ea7ec49ab * view.c (display): Use only declared color pairs to fix hex
editor appearance with ncurses.  Eliminate some useless defines.
2002-08-14 07:41:01 +00:00
Pavel Roskin
d0b31c1c81 * key.c (delete_select_channel): Avoid using freed memory. 2002-08-10 04:37:13 +00:00
Pavel Roskin
c46d1f590b * ext.c (exec_extension): Eliminate unused argument.
(regex_command): Remove support for user actions.  Return int.
Adjust all dependencies.
2002-08-10 00:37:55 +00:00
Pavel Roskin
bb4451f170 * ext.c (exec_extension): Make static. Remove support for Drop,
Title and Icon actions.  Adjust all dependencies.
2002-08-10 00:14:01 +00:00
Pavel Roskin
b7cdfa9c93 * main.c (sigchld_handler_no_subshell) [linux]: SIGTSTP is
always defined on Linux.
* subshell.c (sigchld_handler): No need to use SIGTSTP
explicitly when we really care about SIGCONT.
2002-08-09 23:36:06 +00:00
Pavel Roskin
a1aabfff50 * ncurses.patch: Remove, it's obsolete.
* Makefile.am: Remove ncurses.patch.
2002-08-09 22:00:27 +00:00
Pavel Roskin
56368fe9f2 * lib/xnc.hlp: Move ...
* doc/xnc.hlp: ... here.
* doc/Makefile.am: Necessary adjustments.
* lib/Makefile.am: Likewise.
* src/Makefile.am: Likewise.
2002-08-09 21:55:20 +00:00
Pavel Roskin
e26cef8825 * subshell.c: Assume that SIGTSTP and SIGCONT are always
defined.  This is now checked in configure.  Otherwise
synchronize() would hang until subshell exits.
2002-08-04 06:59:34 +00:00
Pavel Roskin
e2a37d3809 * charsets.c: Unconditionally enable finalization code that was
only used with HAVE_MAD.
* color.c: Likewise.
* color.h: Likewise.
* key.c: Likewise.
* main.c: Likewise.
* slint.c: Likewise.
* subshell.c (exit_subshell): Free subshell_prompt.
2002-08-01 20:31:52 +00:00
Pavel Roskin
105cb58726 * mad.c: Remove.
* mad.h: Likewise.
* Makefile.am (SRCS): Remove mad.c and mad.h.
* cmd.c: Remove references to MAD.
* main.c: Likewise.
* dlg.c: Use inline, not INLINE.
* hotlist.c: Likewise.
* menu.c: Likewise.
* global.h: Don't include mad.h.
2002-08-01 19:40:43 +00:00
Andrew V. Samoilov
a583a32a73 * key.h (key_code_name_t): Typedef const. 2002-07-31 00:35:06 +00:00
Andrew V. Samoilov
8025b4bce4 * ext.c (regex_command): Don't check same condition twice.
(exec_extension): Comment out useless loop.
2002-07-31 00:28:07 +00:00
Andrew V. Samoilov
10044de5b9 * man2hlp.c (main): Don't use freed structure member. 2002-07-31 00:08:51 +00:00
Pavel Roskin
80561f39a7 * man2hlp.c (main): Use only stream I/O. Fix checks for error
conditions.  Reformat the whole file.
2002-07-30 22:57:01 +00:00
Pavel Roskin
7e2fd7960e * man2hlp.c: Avoid the need to use gindex.pl.
From Andrew V. Samoilov <sav@bcs.zp.ua>
* Makefile.am: Use man2hlp directly.
(EXTRA_DIST): Remove gindex.pl.
* gindex.pl: Remove.
2002-07-30 22:20:26 +00:00
Pavel Roskin
b698076e0e * ext.c (regex_command): Additional check to prevent reading
unallocated memory when matching "shell/".  Found by Valgrind.
2002-07-30 05:39:48 +00:00
Pavel Roskin
bda707e46b * setup.c: Eliminate all PORT* macros.
* screen.c: Likewise.
2002-07-30 00:12:53 +00:00
Pavel Roskin
2935c85c85 * subshell.c (feed_subshell): Reading 0 bytes in a channel with
FD_ISSET being set is a sign of something being wrong - exit
immediately.  Observed when mc is run under su in xterm and
xterm is closed while the subshell is running.
Reported by Vlad Harchev <hvv@hippo.ru>
2002-07-30 00:03:26 +00:00
Pavel Roskin
777c46ee2a * color.h: Replace PORT_COLOR macro with BEST_COLOR, which uses
MY_COLOR_PAIR.
2002-07-29 23:37:22 +00:00
Pavel Roskin
6c7e1a46c8 * util.c: Remove unused functions.
* utilunix.c: Likewise.
* util.h: Update to match.
2002-07-29 23:12:31 +00:00
Pavel Roskin
0d360dca23 Remove irrelevant comment. 2002-07-29 22:14:16 +00:00
Pavel Roskin
b8f676ec41 * cons.saver.c: Use SEEK_SET instead of 0 in lseek().
* view.c: Likewise.
2002-07-29 21:18:51 +00:00
Pavel Roskin
17ceeead44 * main.c (do_execute): Add newline after "Press any key to
continue".
2002-07-29 19:30:41 +00:00
Pavel Roskin
7bab33656b * cons.saver.c: Eliminate some global variables. Further
cleanup.  Make sure that console_fd is always closed.
2002-07-29 05:59:07 +00:00
Pavel Roskin
edebd94750 * cons.saver.c: Remove support for Linux kernels before 2.0.
Massive cleanup.
(send_contents): Remove incorrect optimization - restore even
empty lines because they may be touched by the viewer.
From Denis Vlasenko <vda_unique@iname.com>
2002-07-28 08:52:27 +00:00
Pavel Roskin
18c160fefa * utilunix.c (canonicalize_pathname): Don't extend empty path
to "." - it can corrupt memory.
2002-07-26 21:51:16 +00:00
Pavel Roskin
1c1493cbe5 * cmd.c (copymove_cmd_with_default): Remove, it's unused.
(copy_cmd_local): New function, copy within panel.
(ren_cmd_local): New function, rename within panel.
* cmd.h: Adjust to match.
* screen.c (panel_keymap): Associate F15 with copy_cmd_local and
F16 with ren_cmd_local.
2002-07-26 19:30:13 +00:00
Pavel Roskin
0389cbf16c * view.c (display): Don't highlight characters as bold if the
character before the backspace was different.
From Roland Illig <roland.illig@gmx.de>
2002-07-26 17:17:41 +00:00
Andrew V. Samoilov
b5cfea00e1 * wtools.c (message): Fix possible buffer overflow. 2002-07-25 18:07:42 +00:00
Andrew V. Samoilov
8c9c34918b util.[ch] (app_text): Make const and adjust declaration. 2002-07-25 13:48:00 +00:00
Andrew V. Samoilov
eb7d542f24 * profile.c: Make AppName parameter const char * everywhere.
* profile.h: Adjust declarations.
2002-07-25 13:44:06 +00:00
Andrew V. Samoilov
e94799f762 * slint.c [HAVE_MAD] (dealloc_color_pairs): Move ...
* color.c [HAVE_MAD]: ... here and make accessible from
other files to fix compilation.
* color.h [HAVE_MAD]: Declare dealloc_color_pairs.
2002-07-25 13:04:19 +00:00
Pavel Roskin
8f4ca50c58 * screen.c (panel_callback): Revert last change, it has bad side
effects on the subshell.
2002-07-20 08:32:53 +00:00
Pavel Roskin
6bdeafba4d * dlg.c: Eliminate all useless x_* functions.
* dlg.h: Likewise.
* panel.h: Likewise.
* textconf.h: Likewise.
* view.c: Likewise.
* view.h: Likewise.
* widget.c: Likewise.
* main.c: Remove panel_update_marks(). Move try_to_select() ...
* screen.c: ... here.  Eliminate x_* functions.
* main.h: Remove panel_update_marks().
2002-07-19 22:16:24 +00:00
Pavel Roskin
f61bfaf8f5 * screen.c (panel_callback): Only change directory on
WIDGET_FOCUS if current_panel changes.
2002-07-19 20:22:07 +00:00
Pavel Roskin
17671c4de9 * main.c (handle_args): Don't call mc_get_current_wd(). 2002-07-19 19:08:26 +00:00
Pavel Roskin
ead99974fb * main.c (directory_history_list): Report error if cannot change
directory.
2002-07-19 05:03:44 +00:00
Pavel Roskin
bb34f88152 * main.c (do_execute): Don't ask to press any key when the shell
is running a command - the user has already pressed Ctrl-O.
2002-07-16 06:00:54 +00:00
Pavel Roskin
a2e8277428 * slint.c: Eliminate hardcoded color terminals. Most users no
longer need this hack, and those who do have color_terminals
option in the config file.
2002-07-15 06:01:29 +00:00
Pavel Roskin
82e481b78d * color.c [USE_NCURSES]: Eliminate division by COLOR, it's 0 in
black and white mode.
2002-07-14 22:18:12 +00:00
Pavel Roskin
b0dfc1b672 * slint.c: Move functions for allocating color pairs ...
* color.c: ... here.  Implement ncurses equivalents.  Rename
init_pair() to mc_init_pair() and keep tack of max_index with
ncurses.  Adjust all dependencies.
2002-07-14 21:41:12 +00:00
Pavel Roskin
6ffc6bde22 * mem.h: Clean up obsolete definitions, incorporate into ...
* global.h: ... this.
* Makefile.am: Remove mem.h.
2002-07-14 19:34:17 +00:00
Pavel Roskin
a2f136fdc3 s/ommited/omitted/ 2002-07-14 06:36:07 +00:00
Pavel Roskin
0ce1cd7354 * Makefile.am (AM_CPPFLAGS): Remove REGEX_MALLOC, it's now in
configure.in.
2002-07-13 19:11:03 +00:00
Pavel Roskin
4f4e0c2d2e * tty.h: Use standard autoconf defines to determine which
ncurses header to include.  Eliminate RENAMED_NCURSES.
2002-07-13 05:13:07 +00:00
Pavel Roskin
129df509f9 * utilunix.c: Cast argument for GUINT_TO_POINTER to int to fix
warnings on Cygwin.
2002-07-10 23:27:36 +00:00
Pavel Roskin
073e17a8d0 * subshell.c: ioctl() doesn't set errno - don't use perror() to
report failures.  Use fprintf() instead, ignore errors from
TIOCSWINSZ.
(resize_tty): New function - code common for resize_subshell()
and init_subshell_child().
2002-07-10 22:49:08 +00:00
Pavel Roskin
200356c074 * global.h: Include vfs.h.
* boxes.c (configure_vfs): Ask whether .netrc should be used.
From Thomas Zajic <zlatko@gmx.at>
2002-07-10 21:20:49 +00:00
Pavel Roskin
74288460f5 * file.c (do_transform_source): Cast the argument to functions
for character classification to unsigned int.
* main.c (handle_args): Likewise.
* util.c (size_trunc_sep): Likewise.
(skip_numbers): Likewise.
2002-07-03 19:47:40 +00:00
Pavel Roskin
0c0a5ae270 * subshell.c (sigchld_handler): Remove subshell_pty from the
channel list if the subshell has died.
2002-07-03 16:35:42 +00:00
Pavel Roskin
a83d080370 * mad.[ch] [__GNUC__] (mad_strconcat): Use macro varargs.
(mad_strdup_printf): Likewise.
(mad_strdup_vprintf): Likewise.
* main.c [HAVE_MAD] (main): Release this_dir and other_dir.
2002-07-03 15:58:54 +00:00
Pavel Roskin
bbbb6eb183 * main.c (stop_dialogs): New function to stop all dialogs.
(quit_cmd_internal): Use stop_dialogs() instead of stopping
midnight_dlg only.  This fixes exit from the shell invoked from
the internal viewer or editor.
2002-07-03 06:19:40 +00:00
Pavel Roskin
90ae932bf6 * cmd.c (view_other_cmd): Shut down extra select channels before
switching to the shell.  Restore them afterwards, but not if
quit was requested.  Skip more code on quit.
2002-07-03 05:56:49 +00:00
Pavel Roskin
2752379086 * util.c: Eliminate get_small_endian_long() and CHECK macro. 2002-07-02 21:25:49 +00:00
Pavel Roskin
3860ff7b34 * util.h: Rename compression types, add a type for uncompressed
files.
* util.c (is_gunzipable): Rename to ...
(get_compression_type): this.  Don't check archive length, since
it's unreliable if there is padding at the end of the file.
Eliminate prehistoric Linux workaround.  All callers adjusted.

* utilunix.c (close_error_pipe): Use "%s" in message () to
prevent possible crash.
(check_error_pipe): Likewise.
2002-07-02 21:09:25 +00:00
Andrew V. Samoilov
9e174e05f6 * utilunix.c (close_error_pipe): Use "%s" in message () to
prevent possible crash.
(check_error_pipe): Likewise.
2002-07-01 19:08:44 +00:00
Pavel Roskin
29633b4eb5 * screen.c (do_enter_on_file_entry): Process associations before
trying to execute the file.
2002-06-27 21:25:03 +00:00
Pavel Roskin
96632fcff1 * dir.c (handle_dirent): Don't process ".." entries.
(handle_path): Likewise.
From Andrew V. Samoilov <kai@cmail.ru>
2002-06-20 21:10:06 +00:00
Pavel Roskin
5ac5f41332 * slint.c (has_colors): Don't reset SLtt_Use_Ansi_Colors to 0 if
force_colors is not set.  This fixes color on unknown terminals.
2002-06-13 12:40:50 +00:00
Andrew V. Samoilov
5f2c890ba7 * user.c (expand_format): Fix '%b' proccessing.
Handle '%k' as documented.
2002-06-13 11:22:04 +00:00
Andrew V. Samoilov
f2ea65904e * main.c [HAVE_MAD && !_OS_NT] (main): G_free mc_home. 2002-05-30 13:35:09 +00:00
Andrew V. Samoilov
d073133873 * mad.c (mad_tempnam): Commented out to make linker happy. 2002-05-30 13:27:43 +00:00
Andrew V. Samoilov
320b3cedae * view.c (regexp_search): Don't call save_edit_changes
if there are no changes.
(save_edit_changes): Use messages from ../po/mc.pot.
2002-05-30 13:12:56 +00:00
Andrew V. Samoilov
53a7967f74 * view.c (save_edit_changes): Handle errors.
(do_view_init): Don't open and check file type
if _command is not null or _file is empty string.
2002-05-27 16:20:35 +00:00
Pavel Roskin
1dade2fbc4 * Makefile.am: doc/mc.1 is in top_builddir, not in top_srcdir. 2002-05-22 16:10:52 +00:00
Andrew V. Samoilov
a876d1a17d * view.c (do_view_init): Close fd if it is unused. 2002-05-15 14:44:54 +00:00
Andrew V. Samoilov
040cbd2e6b * Makefile.am (VFSLIB): Add ../vfs/samba/libsamba.a
if USE_WITH_SAMBA is true.
2002-05-14 12:39:04 +00:00
Pavel Roskin
2e8c3085e8 * hotlist.c (hotlist_button_callback): Don't process B_REMOVE
for VFS list - it would crash.
From Andrey Panov <pav@metib.ru>
2002-05-07 05:37:04 +00:00
Andrew V. Samoilov
5a255dd2ea * main.c [!WITH_MCFS] (PanelMenu): Eliminate mcfs related entry.
(RightMenu): Likewise.
* textconf.c (features): Likewise.
* cmd.c (netlink_cmd) [!WITH_MCFS]: Eliminate.
2002-04-19 07:21:09 +00:00
Pavel Roskin
c942254c57 * Makefile: mc.hlp should be in MAINTAINERCLEANFILES, not in
CLEANFILES, because "make clean" should not make the source
directory useless on systems without Perl.
2002-04-03 07:41:12 +00:00
Andrew V. Samoilov
6edfce4e7b * Makefile.am (CLEANFILES): Add mc.hlp. 2002-03-28 15:44:52 +00:00
Andrew V. Samoilov
3c239079b2 * eregex.h [!USE_INCLUDED_REGEX]: Include <regex.h>.
* regex.c: Compile only if USE_INCLUDED_REGEX is defined.
2002-03-26 14:13:10 +00:00
Andrew V. Samoilov
7f08501250 * src/Makefile.am: Move mc.hlp.ru processing ...
* doc/ru/Makefile.am: ... here.
2002-03-26 13:22:32 +00:00
Andrew V. Samoilov
8766ce3b02 * cmd.[ch] [USE_INTERNAL_EDIT] (edit_syntax_cmd:) New dialog
to edit Syntax Highlighting definitions file.
* main.c (CmdMenu) [USE_INTERNAL_EDIT]: Add 'Syntax file edit'
entry.
(process_args): Print mc's library directory to stdout.
2002-03-25 07:46:18 +00:00
Andrew V. Samoilov
ac26b4f20e * complete.c (insert_text): Fix buffer overflow. 2002-03-25 07:28:25 +00:00
Andrew V. Samoilov
0154dbfdc3 * man2hlp.c (handle_link): Strip .B and .I
* gindex.pl: Use fifth argument as man2hlp location.
2002-03-21 13:01:20 +00:00
Andrew V. Samoilov
20dd6b4e88 * man2hlp.c (handle_command): Handle backslash quoting
for .I and .B
2002-03-21 08:13:58 +00:00
Andrew V. Samoilov
830c9ae976 * man2hlp.c (handle_command): Handle '.\"TOPICS' comment.
Use it for translated 'Topics:' message.
* gindex.pl: Use first line of man2hlp output as
translated 'Topics:' message if fourth argument
is empty string.
* Makefile.am (mc.hlp.ru): Use empty string as gindex.pl's
fourth argument.
2002-03-20 14:03:55 +00:00
Andrew V. Samoilov
fae9735bb9 * textconf.c (version): Write to stdout.
* main.c (print_mc_usage): Add "stream" parameter to specify
file stream.
(process_args): Use print_mc_usage() with stdout as stream.
(handle_args): Use print_mc_usage() with stderr as stream.
(print_color_usage): Write to stdout.
2002-03-20 11:28:08 +00:00
Pavel Roskin
7ca687c8ed * eregex.h: Update from glibc-2.2.5.
* regex.c: Likewise.
* find.c: Use eregex.h, not regex.h.
* util.c: Likewise.
* view.c: Likewise.
From Alexander Varakin <avarakin00@hotmail.com>
2002-03-18 21:08:18 +00:00
Pavel Roskin
ebe22f53db * find.c (find_parameters): Invert condition when find is case
sensitive.
2002-03-18 20:04:13 +00:00
Pavel Roskin
5e7549d346 Add mc.hlp.?? 2002-03-12 16:26:53 +00:00
Andrew V. Samoilov
5f2ae160c0 * file.c (copy_file_file): Rollback one hunk to eliminate infinitive loop. 2002-03-06 07:37:14 +00:00
Andrew V. Samoilov
0e0fdc3aa6 * Makefile.am (mc.hlp.ru): Use mc.1 instead of mc.1.in.
(mc.hlp): Likewise.
2002-03-04 14:54:34 +00:00
Andrew V. Samoilov
4bfeff6aca * Makefile.am (mc.hlp.ru): Use mc.1 instead of mc.1.in.
(mc.hlp): Likewise.
2002-03-04 14:09:09 +00:00
Andrew V. Samoilov
8ce8833c37 * file.c (copy_file_file): Chmod destination only if
ctx->preserve is on.  Eliminate gotos.
2002-03-04 13:52:39 +00:00
Andrew V. Samoilov
51e1d26419 * Makefile.am (mc.hlp.ru): New rule to compile translated
help file.
(mclib_DATA): Add mc.hlp.ru.
2002-03-01 15:05:20 +00:00
Andrew V. Samoilov
e587297a62 * gindex.pl: Add optional 4th argument for translated
Content section name.
2002-03-01 14:08:03 +00:00
Andrew V. Samoilov
760d6a8115 * gindex.pl: Use [nodename] as user visible section name
only if next line is empty.  Elsewhere use this nonempty line.
2002-02-28 16:49:26 +00:00
Andrew V. Samoilov
10517bd1fc * mad.c: Make mem_areas dynamically growing.
(mad_init): Allocate memory for mem_areas.
(mad_alloc): Grow mem_areas if it is exhausted.
2002-02-28 15:36:00 +00:00
Andrew V. Samoilov
0f4a7d26f8 * filegui.c (file_mask_dialog): Enable 'follow Links'
and 'preserve Attributes' features in Move dialog.
(file_bps_show): Translate messages.
(file_eta_show): Likewise.
2002-02-28 15:18:10 +00:00
Andrew V. Samoilov
b5a0c42e21 (handle_command): Handle '.\"NODE' comment. Use it for
nodename in translated manual pages.
2002-02-28 14:38:38 +00:00
Andrew V. Samoilov
ad0767356f * man2hlp.c (main): Don't crash if called without argument(s).
Make `buffer' char pointer.
2002-02-28 14:12:34 +00:00
Andrew V. Samoilov
3de820819f * find.c (find_parameters): Compile content_pattern here.
Inform user about alformed regular expression.
(search_content): Use compiled regular expression.
(do_find): Eliminate `done'.  Call regfree for compiled
content_pattern.
2002-02-28 13:50:03 +00:00
Pavel Roskin
b9e4f7c338 * chown.c (chown_cmd): Use size_trunc_len() to show the file
size.  Eliminate c_fsize, which wasn't properly initialized.
2002-02-24 07:17:47 +00:00
Pavel Roskin
7346c6f93e * man2hlp.c (string_len): Don't exclude characters with codes
above 128 from the string length.
2002-02-22 05:54:00 +00:00
Andrew V. Samoilov
c13770201f * ext.c (exec_extension): Use "#! /bin/sh". 2002-02-21 14:37:51 +00:00
Pavel Roskin
8c9fc66db0 * background.c (background_attention): Cast pointer to long
instead of int because it's unsafe of 64-bit systems.
* main.c (init_xterm_support): Likewise.
2002-02-21 01:49:29 +00:00
Pavel Roskin
6c67d1918c * utilunix.c (canonicalize_pathname) [__QNX__]: Fix detection
of Qnet names.  Disable support of Qnet names under QNX Netrino.
Reported by Maurizio Rossi <MRossi@system-group.it>
2002-02-18 22:31:56 +00:00
Pavel Roskin
2b7cf88d85 * global.h: Include unix.h under "classical" QNX.
* subshell.c: Don't include unix.h.
* utilunix.c: Likewise.
2002-02-18 21:54:27 +00:00
Andrew V. Samoilov
455e64673e * main.c (update_one_panel_widget): Call ftpfs_flushdir(). 2002-02-07 19:24:44 +00:00
Pavel Roskin
5257da5f83 * key.c [USE_NCURSES] (get_key_code): Ignore KEY_RESIZE.
* layout.c [USE_NCURSES] (flag_winch): Don't call
low_level_change_screen_size() from signal handler.
From Thomas Dickey <dickey@herndon4.his.com>
2002-02-06 05:23:50 +00:00
Pavel Roskin
9a67ad6ebf * screen.c (format_file): Add a new parameter (size of the
output buffer) to prevent buffer overflow on very wide
terminals.
From Thomas Dickey <dickey@herndon4.his.com>
2002-02-06 05:14:16 +00:00
Andrew V. Samoilov
aa2832dff9 * util.c [!HAVE_TRUNCATE] (truncate): Close fd if my_ftruncate
fails.

* util.c [HAVE_CHARSET] (is_printable): Eliminate printable.
* setup.c [HAVE_CHARSET] (load_setup): Don't use
init_printable_table().

* charset.c (printable): Removed.
(init_printable_table): Removed.
2002-02-04 18:09:42 +00:00
Andrew V. Samoilov
ce7bae4dd7 * file.c (recursive_erase): Use mc_closedir() if mc_lstat()
fails.  Eliminate goto.
(erase_dir): Eliminate goto.
(erase_dir_iff_empty): Likewise.
2002-01-30 11:15:39 +00:00
Andrew V. Samoilov
4b84517072 * charsets.c (translate_character): Use ICONV_CONST. 2002-01-29 15:10:00 +00:00
Andrew V. Samoilov
3cb3d285df * dir.c (handle_dirent): Use MSG_ERROR. 2002-01-29 08:10:36 +00:00
Pavel Roskin
3ecaa166e8 * screen.c: Don't try to paint anything if width is 0 or less.
Reported by Pawel Sakowski <pawel@sakowski.eu.org>
2002-01-22 23:37:41 +00:00
Pavel Roskin
34fe9abd28 * screen.c: Make functions static whenever possible. Remove
unused functions.
* panel.h: Remove corresponding declarations.
2002-01-22 23:16:21 +00:00
Pavel Roskin
e5c6976b15 * util.c: Move replacements for permission bits ...
* fs.h: ... here.  Add more replacements.
* global.h: Include direct.h only with MSVC.
2002-01-22 01:23:18 +00:00
Pavel Roskin
93fd1572a5 * main.c: Include "drive.h", not <drive.h>, do it after panel.h.
Use _OS_NT as the condition for including drive.h.
* screen.c: Use _OS_NT as the condition for including drive.h.
2002-01-22 00:30:51 +00:00
Pavel Roskin
22b2813349 * global.h [_OS_NT]: Include io.h, direct.h and windows.h.
Don't redefine struct timeval.
2002-01-22 00:24:36 +00:00
Pavel Roskin
af3bb307d1 * fs.h [_MSC_VER]: Use dirent provided by glib. 2002-01-21 23:09:07 +00:00
Pavel Roskin
d99d279148 * global.h [!HAVE_SYS_TIME_H]: Provide a replacement for struct
timeval.
2002-01-21 22:46:22 +00:00
Pavel Roskin
d9c035d2c2 Fixed #elif. 2002-01-21 21:29:55 +00:00
Pavel Roskin
7b8b4394d5 * findme.c: Respect HAVE_UNISTD_H.
* popt.c: Likewise.
2002-01-21 21:04:44 +00:00
Pavel Roskin
a504067e6c * global.h: Fallback to sys/utime.h if utime.h is missing. 2002-01-21 20:57:31 +00:00
Pavel Roskin
3a9692b680 * global.h: Provide fallbacks for getuid(), getgid(), geteuid()
and getegid().
* fs.h: Fully trust HAVE_DIRENT_H.
* complete.c: Don't include dirent.h directly, fs.h takes care
of it.
* file.c: Likewise.
* filegui.c: Likewise.
* main.c: Likewise.
* treestore.c: Likewise.
2002-01-21 20:47:05 +00:00
Pavel Roskin
4df07d04be * global.h [!__GNUC__]: Define __attribute__ with one argument. 2002-01-21 19:57:48 +00:00
Pavel Roskin
3e8ada15be * screen.c (string_file_size): Translate "UP--DIR".
(string_file_size_brief): Translate "SUB-DIR" and "SYMLINK".
2002-01-20 20:14:15 +00:00
Pavel Roskin
c14f6363da * dir.c (add_dotdot_to_list): Don't use costly stat() - just put
realistic (i.e. bogus) data to the list.
2002-01-20 20:05:40 +00:00
Pavel Roskin
894ed9dcc6 * screen.c (string_file_size): Don't display size of ".." - it
may take too much time to calculate it on VFS.  Show "UP--DIR"
instead.
(string_file_size_brief): Remove ".." handling - it's now done
in string_file_size().  Show "SUB-DIR" for links to directories,
"SYMLINK" for other links.
2002-01-20 19:52:11 +00:00
Pavel Roskin
73ed832576 * cmd.c: Remove OS/2 specific code.
* file.c: Likewise.
* main.c: Likewise.
2002-01-17 07:23:50 +00:00
Pavel Roskin
030d1bf2ad * main.h: Remove dead declarations.
* setup.c: Remove defunct extension alignment support.
* util.c: Likewise.
* util.h: Likewise.
2002-01-17 07:17:54 +00:00
Pavel Roskin
03f801b0f2 * main.c: Remove unused toggle_* functions. 2002-01-17 06:56:22 +00:00
Pavel Roskin
ff7208e93b * dir.c: Show backups by default. 2002-01-17 05:42:00 +00:00
Andrew V. Samoilov
7d88c34470 * file.c (copy_dir_dir): Check the destination is a directory
if it exists. Reported by Thomas <metaf4@pseudonym.org>.
2002-01-15 08:01:29 +00:00
Andrew V. Samoilov
21c015b2f8 * util.c (string_perm) [S_IFDOOR]: Support Solaris doors.
screen.c (string_file_type) [S_IFDOOR]: Likewise.
2002-01-09 10:54:13 +00:00
Pavel Roskin
9e23676939 * hotlist.c (hotlist_callback): Recognize "delete" key. 2001-12-22 01:29:20 +00:00
Pavel Roskin
08cb611abf * myslang.h [!HAVE_SYSTEM_SLANG]: Include slang/slang-mc.h to
simplify includes.
[HAVE_SYSTEM_SLANG]: Use angle brackets for slang.h.
2001-12-21 22:15:24 +00:00
Pavel Roskin
1e15aecb9f * myslang.h [!HAVE_SYSTEM_SLANG]: Include slang-mc.h directly
to avoid relying on symlinks.
2001-12-21 20:17:22 +00:00
Pavel Roskin
5d27f706bd * utilunix.c (init_groups): Don't return prematurely if the
primary group cannot be found (it can happen on Cygwin).
2001-12-18 20:00:27 +00:00
Pavel Roskin
340f689384 * dir.c (do_reload_dir): Hash-table added.
From Bjrn Eriksson <mdeans@algonet.se>
2001-12-11 00:30:12 +00:00
Pavel Roskin
b8eecba1d9 Comment fix. From Bjrn Eriksson <mdeans@algonet.se> 2001-12-07 02:47:04 +00:00
Pavel Roskin
27d176979b s/crush/crash/ and other minor things. 2001-12-03 23:38:11 +00:00
Pavel Roskin
111c11418a * dir.c (do_reload_dir): Optimize the logic - count the marks
and only match new entries against old entries if at least one
mark has not been transferred.
From Bjrn Eriksson <mdeans@algonet.se>
2001-12-03 21:39:41 +00:00
Pavel Roskin
acbe83ef9c * main.c (midnight_callback): Implement "auto menus". 2001-11-29 21:03:16 +00:00
Pavel Roskin
905b9ac8f8 * layout.c: Make more variables static. 2001-11-29 20:30:50 +00:00
Pavel Roskin
d816549ab9 * cons.saver.c: Define LINUX_CONS_SAVER_C so that some parts
of cons.saver.h can be omitted.
* cons.saver.h: Declare nothing but constants if
LINUX_CONS_SAVER_C is defined.
2001-11-29 20:28:48 +00:00
Pavel Roskin
fa89635b51 Fully eliminate all references to HAVE_X and HAVE_GNOME. 2001-11-14 23:20:37 +00:00
Pavel Roskin
d62c8ee427 * dir.c (do_sort): Correctly handle the case when there is no
".." entry (i.e. panelized mode).
2001-11-14 20:32:47 +00:00
Pavel Roskin
e50abb3f80 * view.c (do_view_init): Make sure _file is not
an empty string before mc_stat and mc_open.
Memory leak fixed.
2001-11-14 20:15:36 +00:00
Pavel Roskin
79dd5b30cb * panelize.c (do_external_panelize): Re-sort the panel according
to the current settings.
2001-11-14 20:06:08 +00:00
Pavel Roskin
86213a2be0 * find.c (do_find): Re-sort the panel according to the current
settings when doing panelizing.
2001-11-14 19:59:31 +00:00
Pavel Roskin
47f87cba24 * dir.c (sort_type_to_name): Remove, it's unused in the text
edition.
(sort_name_to_type): Likewise.
* dir.h: Adjust to match.
2001-11-14 18:57:24 +00:00
Pavel Roskin
358abbe0df * mouse.c: Add default cases to fix warnings with gcc-2.96. 2001-11-14 18:27:45 +00:00
Pavel Roskin
b03032c29b * main.c: Remove support for subshell debugging. Firstly, it
was broken.  Secondly, every developer should be able to add
this code when needed.  Finally, there is no need to expose the
option to the user and translate it into 30 languages.
* subshell.h: Remove debug_subshell.
* subshell.c: Likewise.
2001-11-12 22:09:40 +00:00
Andrew V. Samoilov
5f152d9ef0 * mad.h: Enable glib support.
* mad.[ch] (mad_get_current_dir): New function to use instead
of g_get_current_dir.
(mad_tempnam): Add file and line parameters.
(mad_alloc0): Make file parameter const.
(mad_realloc): Likewise.
(mad_strdup): Likewise.
(mad_strndup): Likewise.
(mad_free): Likewise.
(mad_finalize): Likewise.
2001-11-12 07:32:55 +00:00
Andrew V. Samoilov
3964ef8d3c * cmd.c (guess_message_value): Make val static const array.
(smblink_cmd) [!WITH_SAMBA]: Eliminated.
2001-11-08 07:25:16 +00:00
Andrew V. Samoilov
16d1473204 * slint.c (slang_reset_softkeys): Make display static const
array.  Use sizeof (display) - 1 instead of strlen display.
(color_terminals): Make static const array.
(key_table): Make const.

(dealloc_color_pairs) [HAVE_MAD]: New function.  Release
memory allocated in try_alloc_color_pair.
(slang_shutdown) [HAVE_MAD]: Call dealloc_color_pairs.
(try_alloc_color_pair): Move struct c outside function.
2001-11-07 13:35:57 +00:00
Andrew V. Samoilov
35db7bf645 * dlg.c (add_widget): Check for what is not NULL
before everything else.
2001-11-07 12:15:11 +00:00
Andrew V. Samoilov
1cd0a043a7 * charsets.c (load_codepages_list): Use glib memory allocation
functions.
(free_codepages_list) [HAVE_MAD]: New function to release
memory allocated in load_codepages_list.
* charsets.h: Declare free_codepages_list.

* main.c [HAVE_CHARSET]: Include charsets.h.
(main) [HAVE_MAD && HAVE_CHARSET]: Call free_codepages_list.
(program_name): Commented out.
2001-10-29 13:40:00 +00:00
Pavel Roskin
3b32c84134 Add .deps 2001-10-29 06:27:31 +00:00
Andrew V. Samoilov
66600cad98 * TODO: Typo fixed 2001-10-26 11:32:41 +00:00
Andrew V. Samoilov
58f1577542 * key.c (push_char): Fix buffer length calculation.
By drk@sgi.com.
http://bugzilla.gnome.org/show_bug.cgi?id=60932

(define_sequence): Likewise.
(key_define_t): Add const declaration.
2001-10-26 10:21:25 +00:00
Pavel Roskin
f0490b2a06 * main.h: Declare view_one_file and edit_one_file. 2001-10-23 01:39:25 +00:00
Andrew V. Samoilov
dd2ef8b4fb * dialog.h: Include global.h.
(message): Specify __attribute__.
2001-10-22 15:37:27 +00:00
Pavel Roskin
3cdc394c36 * main.h (print_vfs_message): Specify __attribute__. 2001-10-20 07:01:08 +00:00
Pavel Roskin
6eef7a34e7 * global.h: Define __attribute__ to an empty string for non-gcc
compilers so that it's safe to use.
2001-10-20 03:38:41 +00:00
Pavel Roskin
2503eb0342 * view.c (view_hook): Warning fix. 2001-10-18 08:42:20 +00:00
Pavel Roskin
1773a0fee0 * view.c (init_growing_view): Revert last change, it was wrong.
(view_hook): Don't check that the file is regular - it's now
done in do_view_init().  This fixes update problem in quick view
when moving cursor from a regular file to a directory.
2001-10-18 08:39:41 +00:00
Pavel Roskin
37e595b6ba * view.c (do_view_init): Only accept regular files. Use stat(),
not fstat() because open() would hang on pipes.  Avoid opening
the file twice.
(init_growing_view): Take file descriptor, not the filename.
(load_view_file): Likewise.
2001-10-18 06:23:02 +00:00
Pavel Roskin
3ab6f77fee * boxes.c (tree): Rename to tree_box() to avoid confusion.
Adjust all callers and headers.
* main.c (tree_box): Rename to tree_box_cmd().
2001-10-01 06:51:15 +00:00
Pavel Roskin
ea27edf4d5 * tree.c (set_navig_label): Get argument "tree".
(set_navig_label): Likewise.  Adjust all callers.  Don't cast
function tree() to (Widget *) - it's wrong and dangerous.
2001-10-01 06:42:37 +00:00
Pavel Roskin
8e085b98fd * widget.h: Use type "buttonbarfn" more consistently.
* widget.c: Likewise.
2001-10-01 06:31:40 +00:00
Pavel Roskin
958f3f49dd * setup.c [!USE_VFS]: Warning fix.
* hotlist.c [!USE_VFS]: Likewise.
2001-10-01 06:08:56 +00:00
Pavel Roskin
87177d15db * tree.c (tree_navigation_flag): Should not be static. 2001-10-01 05:11:45 +00:00
Pavel Roskin
04392aad1d * screen.c (panel_format_modified): Use more portable cast. 2001-10-01 04:31:49 +00:00
Pavel Roskin
da462709f0 * fileopctx.h: Define new type mc_stat_fn.
* filegui.c (file_mask_dialog): Cast mc_stat and mc_lstat to
mc_stat_fn to prevent warnings without VFS support.
* fileopctx.c (file_op_context_new): Likewise.
2001-10-01 04:20:23 +00:00
Pavel Roskin
2168f2fc50 * find.c: Include rx.h or regex.h
(get_line_at): New function.  Returns malloc()ed null-terminated
line from file file_fd.  Input is buffered in buf_size long
buffer.
(search_content): Don't use external egrep.
Use get_line_at and regexp.
2001-09-23 04:06:35 +00:00
Pavel Roskin
5e3bb68e26 * cmd.c: Change all "long" variables to "off_t" whenever they
are used to store file sizes.
* file.c: Likewise.
* file.h: Likewise.
* fileopctx.h: Likewise.
* tree.c: Likewise.
* filegui.c: Likewise.
(show_bar): Take "double" arguments.  Normalize arguments of
gauge_set_value() before converting them to "int".
2001-09-21 05:04:38 +00:00
Pavel Roskin
34947b1819 * mouse.h: Major cleanup and interface change. init_mouse()
should only be called once, disable_mouse() and enable_mouse()
should be used later.  Distinguish between disabled and
undetected mouse.  Remove debugging stuff.  Adjust all users.
* mouse.c: Implementation of the above.
* key.c: Don't use gpm_flag - check mouse_enabled instead.
2001-09-17 04:43:58 +00:00