From d56dd815b19617df1729d09f2012642c42bdf86e Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Mon, 20 Aug 2001 05:39:21 +0000 Subject: [PATCH] * main.c (mc_maybe_editor_or_viewer) [!USE_INTERNAL_EDIT]: Reenable to make "mc -v" possible. (do_nc): Call mc_maybe_editor_or_viewer() even if the editor is not compiled in. (argument_table) [!USE_INTERNAL_EDIT]: Disable "-e". --- src/ChangeLog | 8 ++++++++ src/main.c | 13 ++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 930c8e3fc..0619db537 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2001-08-19 Pavel Roskin + + * main.c (mc_maybe_editor_or_viewer) [!USE_INTERNAL_EDIT]: + Reenable to make "mc -v" possible. + (do_nc): Call mc_maybe_editor_or_viewer() even if the editor + is not compiled in. + (argument_table) [!USE_INTERNAL_EDIT]: Disable "-e". + 2001-08-19 Andrew V. Samoilov * view.c (view_handle_key) [HAVE_CHARSET]: Remove unneeded diff --git a/src/main.c b/src/main.c index a0648ea1f..6964f43e6 100644 --- a/src/main.c +++ b/src/main.c @@ -2212,12 +2212,10 @@ prepend_cwd_on_local (char *filename) return g_strdup (filename); } -#ifdef USE_INTERNAL_EDIT - static int mc_maybe_editor_or_viewer (void) { - char *path; + char *path = NULL; if (!(view_one_file || edit_one_file)) return 0; @@ -2230,6 +2228,7 @@ mc_maybe_editor_or_viewer (void) setup_dummy_mc (path); view_file (path, 0, 1); } +#ifdef USE_INTERNAL_EDIT else { path = prepend_cwd_on_local (""); #ifndef HAVE_GNOME @@ -2241,25 +2240,22 @@ mc_maybe_editor_or_viewer (void) exit (1); #endif } +#endif /* USE_INTERNAL_EDIT */ g_free (path); midnight_shutdown = 1; done_mc (); return 1; } -#endif /* USE_INTERNAL_EDIT */ - static void do_nc (void) { midnight_dlg = create_dlg (0, 0, LINES, COLS, midnight_colors, midnight_callback, "[main]", "midnight", 0); midnight_dlg->has_menubar = 1; -#ifdef USE_INTERNAL_EDIT /* Check if we were invoked as an editor or file viewer */ if (mc_maybe_editor_or_viewer ()) return; -#endif setup_mc (); @@ -2684,8 +2680,11 @@ static const struct poptOption argument_table [] = { #ifdef HAVE_SUBSHELL_SUPPORT { "dbgsubshell", 'X', POPT_ARG_NONE, &debug_subshell, 0 }, #endif + +#ifdef USE_INTERNAL_EDIT { "edit", 'e', POPT_ARG_STRING, &edit_one_file, 0, N_("Edits one file") }, +#endif #ifndef HAVE_GNOME { "help", 'h', POPT_ARG_NONE, NULL, 'h',