diff options
Diffstat (limited to 'web/attachments/121783-nagiosplug-cvs-progname.diff')
-rw-r--r-- | web/attachments/121783-nagiosplug-cvs-progname.diff | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/web/attachments/121783-nagiosplug-cvs-progname.diff b/web/attachments/121783-nagiosplug-cvs-progname.diff new file mode 100644 index 0000000..8663049 --- /dev/null +++ b/web/attachments/121783-nagiosplug-cvs-progname.diff | |||
@@ -0,0 +1,25 @@ | |||
1 | diff -urN ./plugins/check_ldap.c ../plugins/plugins/check_ldap.c | ||
2 | --- ./plugins/check_ldap.c 2005-01-05 21:53:15.000000000 +0100 | ||
3 | +++ ../plugins/plugins/check_ldap.c 2005-02-17 15:37:46.000000000 +0100 | ||
4 | @@ -19,7 +19,7 @@ | ||
5 | ******************************************************************************/ | ||
6 | |||
7 | /* progname may be check_ldaps */ | ||
8 | -char *progname = "check_ldap"; | ||
9 | +char *progname; | ||
10 | const char *revision = "$Revision: 1.30 $"; | ||
11 | const char *copyright = "2000-2004"; | ||
12 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | ||
13 | @@ -84,9 +84,9 @@ | ||
14 | bindtextdomain (PACKAGE, LOCALEDIR); | ||
15 | textdomain (PACKAGE); | ||
16 | |||
17 | - if (strstr(argv[0],"check_ldaps")) { | ||
18 | - asprintf (&progname, "check_ldaps"); | ||
19 | - } | ||
20 | + progname = strrchr(argv[0], '/'); | ||
21 | + if(progname && strlen(progname > 1)) progname++; | ||
22 | + else progname = argv[0]; | ||
23 | |||
24 | if (process_arguments (argc, argv) == ERROR) | ||
25 | usage4 (_("Could not parse arguments")); | ||