From b7cae0c6e27830cc452a9b49a445813423057b5f Mon Sep 17 00:00:00 2001 From: "Andrew V. Samoilov" Date: Wed, 11 Sep 2002 10:05:24 +0000 Subject: [PATCH] * main.c [WITH_SMBFS]: Include ../vfs/smbfs.h. (argument_table) [WITH_SMBFS]: Add -D, --debuglevel option for smbfs debug level. (process_args) [WITH_SMBFS]: Handle new -D option. (print_mc_usage) [WITH_SMBFS]: Describe -D, --debuglevel option. --- src/ChangeLog | 12 ++++++++++-- src/main.c | 25 ++++++++++++++++++------- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 707d163f2..cd08d4186 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2002-09-11 Andrew V. Samoilov + + * main.c [WITH_SMBFS]: Include ../vfs/smbfs.h. + (argument_table) [WITH_SMBFS]: Add -D, --debuglevel option for + smbfs debug level. + (process_args) [WITH_SMBFS]: Handle new -D option. + (print_mc_usage) [WITH_SMBFS]: Describe -D, --debuglevel option. + 2002-09-11 Pavel Roskin * subshell.c: Move tcsh_fifo to the file scope. Use mc_tmpdir() @@ -67,7 +75,7 @@ * 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 + * util.c: Whenever possible, use standard POSIX macros to test for the file type. Reported by Andrew V. Samoilov @@ -1166,7 +1174,7 @@ 2001-11-07 Andrew V. Samoilov * cmd.c (guess_message_value): Make val static const array. - (smblink_cmd) [!WITH_SAMBA]: Eliminated. + (smblink_cmd) [!WITH_SMBFS]: Eliminated. * dlg.c (add_widget): Check for what is not NULL before everything else. diff --git a/src/main.c b/src/main.c index a43e154d5..86e6a840f 100644 --- a/src/main.c +++ b/src/main.c @@ -87,6 +87,10 @@ #include "../vfs/vfs.h" +#ifdef WITH_SMBFS +#include "../vfs/smbfs.h" /* smbfs_set_debug() */ +#endif + #ifdef HAVE_CHARSET #include "charsets.h" #endif /* HAVE_CHARSET */ @@ -2106,6 +2110,9 @@ print_mc_usage (FILE *stream) " default.\n"), #ifdef USE_NETCODE N_("-l, --ftplog file Log ftpfs commands to the file.\n"), +#ifdef WITH_SMBFS + N_("-D, --debuglevel N Set Smbfs debug level to N (0-10).\n"), +#endif #endif N_("-P, --printwd At exit, print the last working directory.\n" "-s, --slow Disables verbose operation (for slow terminals).\n"), @@ -2195,10 +2202,13 @@ process_args (int c, const char *option_arg) #ifdef USE_NETCODE case 'l': ftpfs_set_debug (option_arg); -#ifdef WITH_SMBFS -/* smbfs_set_debug (option_arg); */ -#endif break; + +#ifdef WITH_SMBFS + case 'D': + smbfs_set_debug (atoi (option_arg)); + break; +#endif #endif case 'm': @@ -2259,6 +2269,9 @@ static const struct poptOption argument_table [] = { #ifdef USE_NETCODE { "ftplog", 'l', POPT_ARG_STRING, NULL, 'l', N_("Log ftp dialog to specified file") }, +#ifdef WITH_SMBFS + { "debuglevel", 'D', POPT_ARG_STRING, NULL, 'D'}, +#endif #endif { "libdir", 'f', POPT_ARG_NONE, NULL, 'f' }, { NULL, 'm', POPT_ARG_NONE, NULL, 'm', @@ -2305,7 +2318,7 @@ handle_args (int argc, char *argv []) { char *tmp; poptContext ctx; - char *option_arg, *base; + char *base; int c; ctx = poptGetContext ("mc", argc, argv, argument_table, @@ -2316,9 +2329,7 @@ handle_args (int argc, char *argv []) #endif while ((c = poptGetNextOpt (ctx)) > 0){ - option_arg = poptGetOptArg (ctx); - - process_args (c, option_arg); + process_args (c, poptGetOptArg (ctx)); } if (c < -1){