* cmd.c: Clean up useless preprocessor directives.

(symlink_cmd): Warning fix.
* dlg.c (dialog_handle_key) [HAVE_X]: Disable suspend on Ctrl-z.
* main.c (do_suspend_cmd) [HAVE_GNOME]: Remove.
(suspend_cmd) [HAVE_GNOME]: Likewise.
This commit is contained in:
Pavel Roskin 2001-05-26 02:00:52 +00:00
parent b5a22403b0
commit 2a6c911579
4 changed files with 22 additions and 21 deletions

View File

@ -1,3 +1,11 @@
2001-05-25 Pavel Roskin <proski@gnu.org>
* cmd.c: Clean up useless preprocessor directives.
(symlink_cmd): Warning fix.
* dlg.c (dialog_handle_key) [HAVE_X]: Disable suspend on Ctrl-z.
* main.c (do_suspend_cmd) [HAVE_GNOME]: Remove.
(suspend_cmd) [HAVE_GNOME]: Likewise.
2001-05-24 Pavel Roskin <proski@gnu.org> 2001-05-24 Pavel Roskin <proski@gnu.org>
* widget.c (update_input) [HAVE_SLANG]: Work around a bug in * widget.c (update_input) [HAVE_SLANG]: Work around a bug in

View File

@ -178,7 +178,7 @@ int view_file_at_line (char *filename, int plain_view, int internal, int start_l
view (0, filename, &move_dir, start_line); view (0, filename, &move_dir, start_line);
repaint_screen (); repaint_screen ();
} }
#endif #endif /* !HAVE_GNOME */
} else { } else {
char *localcopy; char *localcopy;
@ -734,7 +734,7 @@ void reselect_vfs (void)
message (1, MSG_ERROR, _("Could not change directory") ); message (1, MSG_ERROR, _("Could not change directory") );
g_free (target); g_free (target);
} }
#endif #endif /* USE_VFS */
static int compare_files (char *name1, char *name2, long size) static int compare_files (char *name1, char *name2, long size)
{ {
@ -769,7 +769,7 @@ static int compare_files (char *name1, char *name2, long size)
while((n2 = read(file2,buf2,BUFSIZ)) == -1 && errno == EINTR); while((n2 = read(file2,buf2,BUFSIZ)) == -1 && errno == EINTR);
} while (n1 == n2 && n1 == BUFSIZ && !memcmp(buf1,buf2,BUFSIZ)); } while (n1 == n2 && n1 == BUFSIZ && !memcmp(buf1,buf2,BUFSIZ));
result = (n1 != n2) || memcmp(buf1,buf2,n1); result = (n1 != n2) || memcmp(buf1,buf2,n1);
#endif #endif /* !HAVE_MMAP */
close (file2); close (file2);
} }
close (file1); close (file1);
@ -933,14 +933,12 @@ view_other_cmd (void)
" the panels cannot be toggled. ")); " the panels cannot be toggled. "));
message_flag = FALSE; message_flag = FALSE;
} else { } else {
#ifndef HAVE_X
if (use_mouse_p) if (use_mouse_p)
shut_mouse (); shut_mouse ();
if (clear_before_exec) if (clear_before_exec)
clr_scr (); clr_scr ();
if (alternate_plus_minus) if (alternate_plus_minus)
numeric_keypad_mode (); numeric_keypad_mode ();
#endif
#ifndef HAVE_SLANG #ifndef HAVE_SLANG
/* With slang we don't want any of this, since there /* With slang we don't want any of this, since there
* is no mc_raw_mode supported * is no mc_raw_mode supported
@ -948,12 +946,10 @@ view_other_cmd (void)
reset_shell_mode (); reset_shell_mode ();
noecho (); noecho ();
#endif #endif
#ifndef HAVE_X
keypad(stdscr, FALSE); keypad(stdscr, FALSE);
endwin (); endwin ();
if (!status_using_ncurses) if (!status_using_ncurses)
do_exit_ca_mode (); do_exit_ca_mode ();
#endif
mc_raw_mode (); mc_raw_mode ();
if (console_flag) if (console_flag)
restore_console (); restore_console ();
@ -978,7 +974,6 @@ view_other_cmd (void)
if (console_flag) if (console_flag)
handle_console (CONSOLE_SAVE); handle_console (CONSOLE_SAVE);
#ifndef HAVE_X
if (!status_using_ncurses) if (!status_using_ncurses)
do_enter_ca_mode (); do_enter_ca_mode ();
@ -988,7 +983,6 @@ view_other_cmd (void)
init_mouse (); init_mouse ();
if (alternate_plus_minus) if (alternate_plus_minus)
application_keypad_mode (); application_keypad_mode ();
#endif
#ifdef HAVE_SUBSHELL_SUPPORT #ifdef HAVE_SUBSHELL_SUPPORT
if (use_subshell){ if (use_subshell){
@ -1001,9 +995,7 @@ view_other_cmd (void)
LINES-keybar_visible-1); LINES-keybar_visible-1);
} }
#endif #endif
#ifndef HAVE_X
touchwin (stdscr); touchwin (stdscr);
#endif
/* prevent screen flash when user did 'exit' or 'logout' within /* prevent screen flash when user did 'exit' or 'logout' within
subshell */ subshell */
@ -1066,7 +1058,7 @@ do_link (int symbolic_link, char *fname)
if ( ! ((d[0] == '/') && (d[1] == 0))) if ( ! ((d[0] == '/') && (d[1] == 0)))
strcat(d, "/"); strcat(d, "/");
symlink_dialog (s, d, &dest, &src); symlink_dialog (s, d, &dest, &src);
#endif #endif /* !OLD_SYMLINK_VERSION */
if (!dest || !*dest) { if (!dest || !*dest) {
if (src) if (src)
g_free (src); g_free (src);
@ -1096,7 +1088,7 @@ void link_cmd (void)
void symlink_cmd (void) void symlink_cmd (void)
{ {
char *filename; char *filename = NULL;
if (is_a_desktop_panel (cpanel)) { if (is_a_desktop_panel (cpanel)) {
gint i; gint i;
for (i = 0; i < cpanel->count; i++) for (i = 0; i < cpanel->count; i++)
@ -1107,7 +1099,10 @@ void symlink_cmd (void)
} else { } else {
filename = selection (cpanel)->fname; filename = selection (cpanel)->fname;
} }
do_link (1, filename);
if (filename) {
do_link (1, filename);
}
} }
void edit_symlink_cmd (void) void edit_symlink_cmd (void)

View File

@ -650,11 +650,11 @@ static INLINE void dialog_handle_key (Dlg_head *h, int d_key)
do_refresh (); do_refresh ();
break; break;
#ifndef HAVE_X
case XCTRL('z'): case XCTRL('z'):
suspend_cmd (); suspend_cmd ();
/* Fall through */ /* Fall through */
#ifndef HAVE_X
case XCTRL('l'): case XCTRL('l'):
#ifndef HAVE_SLANG #ifndef HAVE_SLANG
/* Use this if the refreshes fail */ /* Use this if the refreshes fail */
@ -662,10 +662,10 @@ static INLINE void dialog_handle_key (Dlg_head *h, int d_key)
do_refresh (); do_refresh ();
#else #else
touchwin (stdscr); touchwin (stdscr);
#endif #endif /* HAVE_SLANG */
mc_refresh (); mc_refresh ();
doupdate (); doupdate ();
#endif #endif /* !HAVE_X */
break; break;
case '\n': case '\n':

View File

@ -1690,7 +1690,6 @@ static void copy_other_tagged (void)
return; return;
copy_tagged (opanel); copy_tagged (opanel);
} }
#endif /* !HAVE_GNOME */
static void do_suspend_cmd (void) static void do_suspend_cmd (void)
{ {
@ -1713,7 +1712,7 @@ static void do_suspend_cmd (void)
/* Restore previous SIGTSTP action */ /* Restore previous SIGTSTP action */
sigaction (SIGTSTP, &sigtstp_action, NULL); sigaction (SIGTSTP, &sigtstp_action, NULL);
} }
#endif #endif /* SIGTSTP */
if (console_flag && !use_subshell) if (console_flag && !use_subshell)
handle_console (CONSOLE_SAVE); handle_console (CONSOLE_SAVE);
@ -1730,7 +1729,6 @@ suspend_cmd (void)
do_refresh (); do_refresh ();
} }
#ifndef HAVE_GNOME
static void static void
init_labels (Widget *paneletc) init_labels (Widget *paneletc)
{ {
@ -1739,7 +1737,7 @@ init_labels (Widget *paneletc)
define_label (midnight_dlg, paneletc, 9, _("PullDn"), menu_cmd); define_label (midnight_dlg, paneletc, 9, _("PullDn"), menu_cmd);
define_label (midnight_dlg, paneletc, 10, _("Quit"), (voidfn) quit_cmd); define_label (midnight_dlg, paneletc, 10, _("Quit"), (voidfn) quit_cmd);
} }
#endif /* HAVE_GNOME */ #endif /* !HAVE_GNOME */
static const key_map ctl_x_map [] = { static const key_map ctl_x_map [] = {
{ XCTRL('c'), (callfn) quit_cmd }, { XCTRL('c'), (callfn) quit_cmd },