if (o_set(sp, cnt, OS_STRDUP, O_STR(sp, cnt), 0)) { o_set(sp, cnt, OS_DEF | OS_STR, NULL, 0);
if (o_set(sp, cnt, OS_NOFREE | OS_STRDUP, O_STR(sp, cnt), 0)) { o_set(sp, cnt, OS_DEF | OS_NOFREE | OS_STR, NULL, 0);
opts_copy(orig, sp)	SCR *orig, *sp;{	int cnt, rval;	/* Copy most everything without change. */	memcpy(sp->opts, orig->opts, sizeof(orig->opts));	/* Copy the string edit options. */	for (cnt = rval = 0; cnt < O_OPTIONCOUNT; ++cnt) {		if (optlist[cnt].type != OPT_STR ||		    F_ISSET(&optlist[cnt], OPT_GLOBAL))			continue;		/*		 * If never set, or already failed, NULL out the entries --		 * have to continue after failure, otherwise would have two		 * screens referencing the same memory.		 */		if (rval || O_STR(sp, cnt) == NULL) {			o_set(sp, cnt, OS_STR, NULL, 0);			o_set(sp, cnt, OS_DEF | OS_STR, NULL, 0);			continue;		}		/* Copy the current string. */		if (o_set(sp, cnt, OS_STRDUP, O_STR(sp, cnt), 0)) {			o_set(sp, cnt, OS_DEF | OS_STR, NULL, 0);			goto nomem;		}		/* Copy the default string. */		if (O_D_STR(sp, cnt) != NULL &&		    o_set(sp, cnt, OS_DEF | OS_STRDUP, O_D_STR(sp, cnt), 0)) {nomem:			msgq(orig, M_SYSERR, NULL);			rval = 1;		}	}	return (rval);}