+ strlcpy(localdata->reason, defaultreason, sizeof(localdata->reason));
+ } else if(argc > 2) {
+ free(localdata);
+ parseError = "gline: invalid number of arguments";
+ return NULL;
+ } else {
+ char *argzerop, *reasonp, *durationp;
+ struct searchNode *durationsn, *reasonsn, *argzerosn;
+
+ if (!(argzerosn=argtoconststr("gline", ctx, argv[0], &argzerop))) {
+ free(localdata);
+ return NULL;
+ }
+
+ if(argc == 1) {
+ durationp = reasonp = NULL;
+ durationsn = reasonsn = NULL;
+
+ /* if we have a space it's a reason */
+ if(strchr(argzerop, ' ')) {
+ reasonsn = argzerosn;
+ reasonp = argzerop;
+ } else {
+ durationsn = argzerosn;
+ durationp = argzerop;
+ }
+ } else {
+ durationsn = argzerosn;
+ durationp = argzerop;
+
+ if (!(reasonsn=argtoconststr("gline", ctx, argv[1], &reasonp))) {
+ durationsn->free(ctx, durationsn);
+ free(localdata);
+ return NULL;
+ }
+ }
+
+ if(!reasonp) {
+ strlcpy(localdata->reason, defaultreason, sizeof(localdata->reason));
+ } else {
+ strlcpy(localdata->reason, reasonp, sizeof(localdata->reason));
+ reasonsn->free(ctx, reasonsn);
+ }
+
+ if(!durationp) {