bp = buff;
safe_str(T("The following commands have hooks: "), buff, &bp);
for (i = 0; i < count; i++) {
- if (gencomp((dbref) 0, ptrs[i], ptrs[i - 1], ALPHANUM_LIST) <= 0)
+ if (i > 0 && gencomp((dbref) 0, ptrs[i], ptrs[i - 1], ALPHANUM_LIST) <= 0)
continue;
- if (i == (count - 1) && i)
+ if (i && i == (count - 1))
safe_str(" and ", buff, &bp);
else if (i)
safe_str(", ", buff, &bp);
{
char tbuf[BUFFER_LEN], *arg2 = tbuf, *tbp;
dbref *results = NULL;
+ char *s;
int nresults;
/* parse first argument into two */
}
}
{
- const char *myargs[4];
+ const char *myargs[MAX_ARG];
+ int i;
+ int j = 2;
myargs[0] = arg2;
myargs[1] = arg3[1];
- myargs[2] = arg3[2];
- myargs[3] = arg3[3];
- nresults = raw_search(player, tbuf, 4, myargs, &results, NULL);
+ for (i = 2; i < INT_MAX && (arg3[i] != NULL); i++) {
+ if ((s = strchr(arg3[i], '='))) {
+ *s++ = '\0';
+ myargs[j++] = arg3[i];
+ myargs[j++] = s;
+ } else {
+ myargs[j++] = arg3[i];
+ }
+ }
+ nresults = raw_search(player, tbuf, j, myargs, &results, NULL);
}
if (nresults == 0) {