]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix argument parsing when specifying the server name on the command line
authorhno <>
Thu, 5 Sep 2002 00:07:46 +0000 (00:07 +0000)
committerhno <>
Thu, 5 Sep 2002 00:07:46 +0000 (00:07 +0000)
(not as an option)

helpers/basic_auth/LDAP/squid_ldap_auth.c

index 609fcf57a47de3cebbc466cab21125c99c9428d0..aa599deab1b557cae7f51b09fd0ad6230bf77a8f 100644 (file)
@@ -26,7 +26,7 @@
  *
  * Changes:
  * 2001-12-12: Michael Cunningham <m.cunningham@xpedite.com>
              - Added TLS support and partial ldap version 3 support. 
*             - Added TLS support and partial ldap version 3 support. 
  * 2001-10-04: Henrik Nordstrom <hno@squid-cache.org>
  *             - 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;