# HG changeset patch # User markus schnalke # Date 1291319559 10800 # Node ID 0afe18a9ee03fba9525d3e4b3ea161878335d2e0 # Parent bd3109ec0f0ada8b3515e178fa0a6d44018954ab fixed previous commit and excluded mode_version() from main() diff -r bd3109ec0f0a -r 0afe18a9ee03 src/masqmail.c --- a/src/masqmail.c Thu Dec 02 16:45:26 2010 -0300 +++ b/src/masqmail.c Thu Dec 02 16:52:39 2010 -0300 @@ -363,6 +363,26 @@ return ret; } +static void +mode_version(void) +{ + gchar *with_resolver = ""; + gchar *with_auth = ""; + gchar *with_ident = ""; + +#ifdef ENABLE_RESOLVER + with_resolver = " +resolver"; +#endif +#ifdef ENABLE_AUTH + with_auth = " +auth"; +#endif +#ifdef ENABLE_IDENT + with_ident = " +ident"; +#endif + + printf("%s %s%s%s%s\n", PACKAGE, VERSION, with_resolver, with_auth, with_ident); +} + int main(int argc, char *argv[]) { @@ -389,8 +409,8 @@ gint debug_level = -1; /* strip the path part */ - progname = strrchr(argc[0], '/'); - progname = (progname) ? progname+1 : argc[0]; + progname = strrchr(argv[0], '/'); + progname = (progname) ? progname+1 : argv[0]; if (strcmp(progname, "mailq") == 0) { mta_mode = MODE_LIST; @@ -531,22 +551,7 @@ } if (mta_mode == MODE_VERSION) { - gchar *with_resolver = ""; - gchar *with_auth = ""; - gchar *with_ident = ""; - -#ifdef ENABLE_RESOLVER - with_resolver = " +resolver"; -#endif -#ifdef ENABLE_AUTH - with_auth = " +auth"; -#endif -#ifdef ENABLE_IDENT - with_ident = " +ident"; -#endif - - printf("%s %s%s%s%s\n", PACKAGE, VERSION, with_resolver, with_auth, with_ident); - + mode_version(); exit(EXIT_SUCCESS); }