- /* Skip whitespace at start of arguments. */
- while (IsSpace(*++endp)) ;
-
- /* At this point, has_cli has one of three values:
- * 0 - no client is identified
- * 1 - a client is identified and must still be registering
- * 2 - a client is identified but may be fully registered
- */
-
- /* Figure out how to handle the command. */
- if (!has_cli) {
- /* Handler does not need a client. */
- handler(iauth, NULL, endp);
- } else {
- /* Try to find the client associated with the request. */
- id = strtol(endp, ¶ms, 10);
- while (IsSpace(*params))
- ++params;
- if (id < 0 || id > HighestFd || !(cli = LocalClientArray[id])) {
- /* Client no longer exists (or never existed). */
- sendto_iauth(NULL, "E Gone :[%s]", params);
- } else if ((!(auth = cli_auth(cli))
- || !FlagHas(&auth->flags, AR_IAUTH_PENDING))
- && (has_cli == 1)) {
- /* Client is done with IAuth checks. */
- sendto_iauth(cli, "E Done :[%s]", params);
- } else {
- struct irc_sockaddr addr;
- char *orig_ip;
-
- /* Skip whitespace before IP address. */
- while (IsSpace(*params))
- ++params;
- /* Record start of IP address, then null terminate it. */
- orig_ip = params;
- while (!IsSpace(*params) && *params != '\0')
- ++params;
- if (IsSpace(*params))
- *params++ = '\0';
- /* Parse out client IP address and port number. */
- res = ipmask_parse(orig_ip, &addr.addr, NULL);
- addr.port = strtol(params, ¶ms, 10);
- /* Skip whitespace and optional sentinel after port number. */
- while (IsSpace(*params))
- ++params;
- if (*params == ':')
- ++params;
- /* Check IP address and port number against expected. */
- if (0 == res
- || irc_in_addr_cmp(&addr.addr, &cli_ip(cli))
- || (auth && addr.port != auth->port)) {
- /* Report mismatch to iauth. */
- sendto_iauth(cli, "E Mismatch :[%s] != [%s]",
- orig_ip, ircd_ntoa(&cli_ip(cli)));
- } else if (handler(iauth, cli, params)) {
- /* Handler indicated a possible state change. */
- check_auth_finished(auth, 0);
- }
- }
- }
+ while (parc < MAXPARA) {
+ while (IsSpace(*message)) /* skip leading whitespace */
+ message++;
+
+ if (!*message) /* hit the end of the string, break out */
+ break;
+
+ if (*message == ':') { /* found sentinel... */
+ params[parc++] = message + 1;
+ break; /* it's the last parameter anyway */
+ }
+
+ params[parc++] = message; /* save the parameter */
+ while (*message && !IsSpace(*message))
+ message++; /* find the end of the parameter */