changeset 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 (2010-12-02)
parents bd3109ec0f0a
children fc1c6425c024
files src/masqmail.c
diffstat 1 files changed, 23 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- 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);
 	}