# HG changeset patch # User markus schnalke # Date 1291319126 10800 # Node ID bd3109ec0f0ada8b3515e178fa0a6d44018954ab # Parent f4117fd5a16366386206fe57f69e76f089348de7 substituted get_progname() with a call to strrchr() diff -r f4117fd5a163 -r bd3109ec0f0a src/masqmail.c --- a/src/masqmail.c Thu Dec 02 16:22:55 2010 -0300 +++ b/src/masqmail.c Thu Dec 02 16:45:26 2010 -0300 @@ -114,18 +114,6 @@ return NULL; } -gchar* -get_progname(gchar * arg0) -{ - gchar *p = arg0 + strlen(arg0) - 1; - while (p > arg0) { - if (*p == '/') - return p + 1; - p--; - } - return p; -} - gboolean write_pidfile(gchar * name) { @@ -400,7 +388,9 @@ gboolean do_verbose = FALSE; gint debug_level = -1; - progname = get_progname(argv[0]); + /* strip the path part */ + progname = strrchr(argc[0], '/'); + progname = (progname) ? progname+1 : argc[0]; if (strcmp(progname, "mailq") == 0) { mta_mode = MODE_LIST; @@ -537,7 +527,6 @@ } if (!mta_mode) { - fprintf(stderr, "arg:%d argc:%d\n", arg, argc); mta_mode = (arg