masqmail

diff src/masqmail.c @ 261:0afe18a9ee03

fixed previous commit and excluded mode_version() from main()
author markus schnalke <meillo@marmaro.de>
date Thu, 02 Dec 2010 16:52:39 -0300
parents bd3109ec0f0a
children fc1c6425c024
line diff
     1.1 --- a/src/masqmail.c	Thu Dec 02 16:45:26 2010 -0300
     1.2 +++ b/src/masqmail.c	Thu Dec 02 16:52:39 2010 -0300
     1.3 @@ -363,6 +363,26 @@
     1.4  	return ret;
     1.5  }
     1.6  
     1.7 +static void
     1.8 +mode_version(void)
     1.9 +{
    1.10 +	gchar *with_resolver = "";
    1.11 +	gchar *with_auth = "";
    1.12 +	gchar *with_ident = "";
    1.13 +
    1.14 +#ifdef ENABLE_RESOLVER
    1.15 +	with_resolver = " +resolver";
    1.16 +#endif
    1.17 +#ifdef ENABLE_AUTH
    1.18 +	with_auth = " +auth";
    1.19 +#endif
    1.20 +#ifdef ENABLE_IDENT
    1.21 +	with_ident = " +ident";
    1.22 +#endif
    1.23 +
    1.24 +	printf("%s %s%s%s%s\n", PACKAGE, VERSION, with_resolver, with_auth, with_ident);
    1.25 +}
    1.26 +
    1.27  int
    1.28  main(int argc, char *argv[])
    1.29  {
    1.30 @@ -389,8 +409,8 @@
    1.31  	gint debug_level = -1;
    1.32  
    1.33  	/* strip the path part */
    1.34 -	progname = strrchr(argc[0], '/');
    1.35 -	progname = (progname) ? progname+1 : argc[0];
    1.36 +	progname = strrchr(argv[0], '/');
    1.37 +	progname = (progname) ? progname+1 : argv[0];
    1.38  
    1.39  	if (strcmp(progname, "mailq") == 0) {
    1.40  		mta_mode = MODE_LIST;
    1.41 @@ -531,22 +551,7 @@
    1.42  	}
    1.43  
    1.44  	if (mta_mode == MODE_VERSION) {
    1.45 -		gchar *with_resolver = "";
    1.46 -		gchar *with_auth = "";
    1.47 -		gchar *with_ident = "";
    1.48 -
    1.49 -#ifdef ENABLE_RESOLVER
    1.50 -		with_resolver = " +resolver";
    1.51 -#endif
    1.52 -#ifdef ENABLE_AUTH
    1.53 -		with_auth = " +auth";
    1.54 -#endif
    1.55 -#ifdef ENABLE_IDENT
    1.56 -		with_ident = " +ident";
    1.57 -#endif
    1.58 -
    1.59 -		printf("%s %s%s%s%s\n", PACKAGE, VERSION, with_resolver, with_auth, with_ident);
    1.60 -
    1.61 +		mode_version();
    1.62  		exit(EXIT_SUCCESS);
    1.63  	}
    1.64