From cd4660487aeb40ceb24ff7da3c36cb8615f12a36 Mon Sep 17 00:00:00 2001 From: Mark Janssen Date: Sun, 27 Jan 2008 16:33:29 +0000 Subject: [PATCH] Set correct (rem)user|pass_given fields when using -F flag git-svn-id: https://proxytunnel.svn.sourceforge.net/svnroot/proxytunnel/trunk/proxytunnel@215 bc163920-b10d-0410-b2c5-a5491ca2ceef --- cmdline.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmdline.c b/cmdline.c index f4fd1b2..a2f3c0e 100644 --- a/cmdline.c +++ b/cmdline.c @@ -303,9 +303,15 @@ int cmdline_parser( int argc, char * const *argv, struct gengetopt_args_info *ar clear_args (); exit(1); } - args_info->user_given = 1; - args_info->pass_given = 1; char *result = getCredentialsFromFile(optarg, &(args_info->user_arg), &(args_info->pass_arg), &(args_info->remuser_arg), &(args_info->rempass_arg) ); + if ( args_info->user_arg != NULL ) + args_info->user_given = 1; + if ( args_info->pass_arg != NULL ) + args_info->pass_given = 1; + if ( args_info->remuser_arg != NULL ) + args_info->remuser_given = 1; + if ( args_info->rempass_arg != NULL ) + args_info->rempass_given = 1; if( result != NULL ) { fprintf( stderr, "%s: Bad password file for `--passfile' (`-F')\n%s\n", PACKAGE, result);