Char *bufnext, *bufend, patbuf[MAXPATHLEN+1];
Char *bufnext, *bufend, patbuf[MAXPATHLEN];
glob(pattern, flags, errfunc, pglob)	const char *pattern;	int flags, (*errfunc) __P((const char *, int));	glob_t *pglob;{	const u_char *patnext;	int c;	Char *bufnext, *bufend, patbuf[MAXPATHLEN+1];	patnext = (u_char *) pattern;	if (!(flags & GLOB_APPEND)) {		pglob->gl_pathc = 0;		pglob->gl_pathv = NULL;		if (!(flags & GLOB_DOOFFS))			pglob->gl_offs = 0;	}	pglob->gl_flags = flags & ~GLOB_MAGCHAR;	pglob->gl_errfunc = errfunc;	pglob->gl_matchc = 0;	bufnext = patbuf;	bufend = bufnext + MAXPATHLEN;	if (flags & GLOB_NOESCAPE)		while (bufnext < bufend && (c = *patnext++) != EOS)			*bufnext++ = c;	else {		/* Protect the quoted characters. */		while (bufnext < bufend && (c = *patnext++) != EOS)			if (c == QUOTE) {				if ((c = *patnext++) == EOS) {					c = QUOTE;					--patnext;				}				*bufnext++ = c | M_PROTECT;			}			else				*bufnext++ = c;	}	*bufnext = EOS;	if (flags & GLOB_BRACE)		return globexp1(patbuf, pglob);	else		return glob0(patbuf, pglob);}