From: hno <> Date: Thu, 5 Sep 2002 00:07:46 +0000 (+0000) Subject: Fix argument parsing when specifying the server name on the command line X-Git-Tag: SQUID_3_0_PRE1~788 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c10afe03b34360d6d2cb095cccb414cb12888e5;p=thirdparty%2Fsquid.git Fix argument parsing when specifying the server name on the command line (not as an option) --- diff --git a/helpers/basic_auth/LDAP/squid_ldap_auth.c b/helpers/basic_auth/LDAP/squid_ldap_auth.c index 609fcf57a4..aa599deab1 100644 --- a/helpers/basic_auth/LDAP/squid_ldap_auth.c +++ b/helpers/basic_auth/LDAP/squid_ldap_auth.c @@ -26,7 +26,7 @@ * * Changes: * 2001-12-12: Michael Cunningham - - Added TLS support and partial ldap version 3 support. + * - Added TLS support and partial ldap version 3 support. * 2001-10-04: Henrik Nordstrom * - Be consistent with the other helpers in how * spaces are managed. If there is space characters @@ -148,15 +148,17 @@ main(int argc, char **argv) case 'P': case 'R': case 'z': + case 'Z': break; default: - if (strlen(argv[1]) > 2 || argc <= 2) { + if (strlen(argv[1]) > 2) { value = argv[1] + 2; - } else { + } else if (argc > 2) { value = argv[2]; argv++; argc--; - } + } else + value = ""; break; } argv++; @@ -251,7 +253,7 @@ main(int argc, char **argv) } } - while (argc > 1 && argv[1][0] == '-') { + while (argc > 1) { char *value = argv[1]; if (ldapServer) { int len = strlen(ldapServer) + 1 + strlen(value) + 1;