if (!(subtype == VSPLUS || subtype == VSLENGTH)) memtodest(p, partlen, syntax, quotes);
varvalue(char *name, int varflags, int flags){	int num;	char *p;	int i;	int sep = 0;	int sepq = 0;	ssize_t len = 0;	char **ap;	char const *syntax;	int quoted = varflags & VSQUOTE;	int subtype = varflags & VSTYPE;	int quotes = flags & (EXP_FULL | EXP_CASE);	if (quoted && (flags & EXP_FULL))		sep = 1 << CHAR_BIT;	syntax = quoted ? DQSYNTAX : BASESYNTAX;	switch (*name) {	case '$':		num = rootpid;		goto numvar;	case '?':		num = exitstatus;		goto numvar;	case '#':		num = shellparam.nparam;		goto numvar;	case '!':		num = backgndpid;		if (num == 0)			return -1;numvar:		len = cvtnum(num);		break;	case '-':		p = makestrspace(NOPTS, expdest);		for (i = NOPTS - 1; i >= 0; i--) {			if (optlist[i]) {				USTPUTC(optletters[i], p);				len++;			}		}		expdest = p;		break;	case '@':		if (sep)			goto param;		/* fall through */	case '*':		sep = ifsset() ? ifsval()[0] : ' ';		if (quotes && (syntax[sep] == CCTL || syntax[sep] == CBACK))			sepq = 1;param:		if (!(ap = shellparam.p))			return -1;		while ((p = *ap++)) {			size_t partlen;			partlen = strlen(p);			len += partlen;			if (len > partlen && sep) {				char *q;				len++;				if (subtype == VSPLUS || subtype == VSLENGTH) {					continue;				}				q = expdest;				if (sepq)					STPUTC(CTLESC, q);				STPUTC(sep, q);				expdest = q;			}			if (!(subtype == VSPLUS || subtype == VSLENGTH))				memtodest(p, partlen, syntax, quotes);		}		return len;	case '0':	case '1':	case '2':	case '3':	case '4':	case '5':	case '6':	case '7':	case '8':	case '9':		num = atoi(name);		if (num < 0 || num > shellparam.nparam)			return -1;		p = num ? shellparam.p[num - 1] : arg0;		goto value;	default:		p = lookupvar(name);value:		if (!p)			return -1;		len = strlen(p);		if (!(subtype == VSPLUS || subtype == VSLENGTH))			memtodest(p, len, syntax, quotes);		return len;	}	if (subtype == VSPLUS || subtype == VSLENGTH)		STADJUST(-len, expdest);	return len;}