if ((fontdirh = FindFirstFile(path, &dir_entry)) == INVALID_HANDLE_VALUE)
if ((fontdirh = FindFirstFile(path, &dir_entry)) == INVALID_HANDLE_VALUE) { xfree(*names); xfree(pattern);
pex_get_matching_names(patLen, pPattern, maxNames, numNames, names)ddUSHORT   patLen;		/* in */ddUCHAR	  *pPattern;		/* in */ddUSHORT   maxNames;		/* in */ddULONG   *numNames;		/* out - number of names found */char    ***names;		/* out - pointer to list of strings */{#ifdef WIN32    HANDLE		fontdirh;    WIN32_FIND_DATA	dir_entry;    char	        path[MAX_PATH];#else    DIR		    *fontdir;    ENTRY           *dir_entry;#endif    char	     pattern[100];    char	     entry[100];    int		     i, head, tail, len, total = 0;        CopyISOLatin1Lowered((unsigned char*)pattern, pPattern, patLen);        if (!(*names = (char **)xalloc((unsigned long)(ABSOLUTE_MAX_NAMES * sizeof(char *)))))	return 0;    #ifdef WIN32    sprintf(path, "%s/*.*", pex_get_font_directory_path());    if ((fontdirh = FindFirstFile(path, &dir_entry)) == INVALID_HANDLE_VALUE)	return 0;#else    if (!(fontdir = opendir(pex_get_font_directory_path())))	return 0;#endif    pex_setup_wild_match(pattern, &head, &tail, &len);    #ifdef WIN32    do#else    while (total < maxNames && (dir_entry = readdir(fontdir)))#endif	{		    if (!get_lowered_truncated_entry(FileName(dir_entry), entry))		continue;	    if (pex_is_matching(entry, pattern, head, tail, len) > 0) {	    		if (!( (*names)[total] = (char *)xalloc((unsigned long)(1 + strlen(entry))))) {		    for (i = 0; i < total; i++)			xfree((*names)[i]);		    xfree(*names);		    return 0;		}				strcpy((*names)[total], entry);		total++;	    }	}#ifdef WIN32    while (total < maxNames && FindNextFile(fontdirh, &dir_entry));#endif#ifdef WIN32    FindClose(fontdirh);#else    closedir(fontdir);#endif        *numNames = total;        return 1;}