rem: if (dir.back() == '%') { if (!vendor) vendor = DEFAULT_VENDOR; if (!typeface) typeface = DEFAULT_TYPEFACE; dir = dir.substring(0, -1) + vendor + "/" + typeface; }
add: if (dir.back() == '%') dir = dir.substring(0, -1) + get_vendor() + "/" + get_typeface();
context: getodir(int o, ErrorHandler *errh){    assert(o >= 0 && o < NUMODIR);        if (!odir[o] && automatic && odir_info[o].envvar)	odir[o] = getenv(odir_info[o].envvar);    #ifdef HAVE_KPATHSEA    if (!odir[o] && automatic && !writable_texdir_tried)	find_writable_texdir(errh);    if (!odir[o] && automatic && writable_texdir) {	String dir = writable_texdir + odir_info[o].texdir;	if (dir.back() == '%') {	    if (!vendor)		vendor = DEFAULT_VENDOR;	    if (!typeface)		typeface = DEFAULT_TYPEFACE;	    dir = dir.substring(0, -1) + vendor + "/" + typeface;	}		// create parent directories as appropriate	int slash = writable_texdir.length() - 1;	while (access(dir.c_str(), F_OK) < 0 && slash < dir.length()) {	    if ((slash = dir.find_left('/', slash + 1)) < 0)		slash = dir.length();	    String subdir = dir.substring(0, slash);	    if (access(subdir.c_str(), F_OK) < 0		&& !nocreate		&& mkdir(subdir.c_str(), 0777) < 0)		goto kpathsea_done;	}	// that's our answer	odir[o] = dir;	odir_kpathsea[o] = dir;    }  kpathsea_done:#endif        if (!odir[o]) {	if (automatic)	    errh->warning("%s not specified, using '.'", odir_info[o].envvar);	odir[o] = ".";    }        while (odir[o].length() && odir[o].back() == '/')	odir[o] = odir[o].substring(0, -1);    return odir[o];}