installalias.c revision 943
1450N/A/*
1450N/A * Copyright (c) 1993, 2009, Oracle and/or its affiliates. All rights reserved.
1450N/A *
1450N/A * Permission is hereby granted, free of charge, to any person obtaining a
1450N/A * copy of this software and associated documentation files (the "Software"),
1450N/A * to deal in the Software without restriction, including without limitation
1450N/A * the rights to use, copy, modify, merge, publish, distribute, sublicense,
1450N/A * and/or sell copies of the Software, and to permit persons to whom the
1450N/A * Software is furnished to do so, subject to the following conditions:
1450N/A *
1450N/A * The above copyright notice and this permission notice (including the next
1450N/A * paragraph) shall be included in all copies or substantial portions of the
1450N/A * Software.
1450N/A *
1450N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1450N/A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1450N/A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
1450N/A * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1450N/A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1450N/A * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1450N/A * DEALINGS IN THE SOFTWARE.
1450N/A */
1450N/A/* Code copied from libXfont is:
1450N/A
1450N/ACopyright 1991, 1998 The Open Group
1450N/A
1450N/APermission to use, copy, modify, distribute, and sell this software and its
1450N/Adocumentation for any purpose is hereby granted without fee, provided that
1450N/Athe above copyright notice appear in all copies and that both that
1450N/Acopyright notice and this permission notice appear in supporting
1450N/Adocumentation.
1450N/A
1450N/AThe above copyright notice and this permission notice shall be included in
1450N/Aall copies or substantial portions of the Software.
1450N/A
1450N/ATHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1450N/AIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1450N/AFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1450N/AOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
1450N/AAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
1450N/ACONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1450N/A
1450N/AExcept as contained in this notice, the name of The Open Group shall not be
1450N/Aused in advertising or otherwise to promote the sale, use or other dealings
1450N/Ain this Software without prior written authorization from The Open Group.
1450N/A
1450N/A*/
1450N/A
1450N/A/*
1450N/A * Ensure that a fonts.alias file only contains aliases for fonts that exist
1450N/A * We do this by first reading in the fonts.dir file and then for
1450N/A * each entry in the fonts.alias file we verify that the alias can
1450N/A * be resolved. Most this of this code is borrowed from
1450N/A * libXfont with minor modifications.
1450N/A */
1450N/A#include <X11/fonts/fntfilst.h>
1450N/A#include <stdio.h>
1450N/A#include <sys/types.h>
1450N/A#include <errno.h>
1450N/A#include <sys/stat.h>
1450N/A#include <ctype.h>
1450N/A#include <limits.h>
1450N/A#include <stdarg.h>
1450N/A#include <stdlib.h>
1450N/A#include <X11/keysym.h>
1450N/A
1450N/A#define EBadFontPath 0
1450N/A#define EBadFontName 0
1450N/A#define EAllocError 0
1450N/A#define Success 1
1450N/A
1450N/Apointer serverClient;
1450N/Astatic char *programName;
1450N/A
1450N/Astatic int lexc(FILE *file);
1450N/A
1450N/Avoid
1450N/AErrorF (const char * f, ...)
1450N/A{
1450N/A va_list args;
1450N/A
1450N/A va_start(args, f);
1450N/A fprintf(stderr, "%s: ", programName);
1450N/A vfprintf(stderr, f, args);
1450N/A va_end(args);
1450N/A}
1450N/A
1450N/A/* Provide pseudo renderers for font file formats we may find in fonts.dir
1450N/A files during installation, but which libXfont does not support */
1450N/A/* ARGSUSED */
1450N/Astatic int
1450N/APseudoOpenScalable (FontPathElementPtr fpe, FontPtr *ppFont, int flags,
1450N/A FontEntryPtr entry, char *fileName, FontScalablePtr vals,
1450N/A fsBitmapFormat format, fsBitmapFormatMask fmask,
1450N/A FontPtr non_cachable_font)
1450N/A{
1450N/A return 1;
1450N/A}
1450N/A
1450N/A/* ARGSUSED */
1450N/Astatic int
1450N/APseudoGetInfoScalable (FontPathElementPtr fpe, FontInfoPtr info,
1450N/A FontEntryPtr entry, FontNamePtr fontName,
1450N/A char *fileName, FontScalablePtr vals)
1450N/A{
1450N/A return 1;
1450N/A}
1450N/A
1450N/Astatic FontRendererRec PseudoRenderers[] = {
1450N/A { ".spd", 4, NULL, PseudoOpenScalable, NULL, PseudoGetInfoScalable, 0 }
1450N/A};
1450N/A
1450N/Astatic void
1450N/APseudoFontFileRegisterFpeFunctions (void)
1450N/A{
1450N/A int i;
1450N/A
1450N/A for (i = 0; i < (sizeof(PseudoRenderers) / sizeof(FontRendererRec)); i++) {
1450N/A FontFileRegisterRenderer(&PseudoRenderers[i]);
1450N/A }
1450N/A}
1450N/A
1450N/Aint
1450N/AProcessFontsDirectory (
1450N/A char *directory,
1450N/A FontDirectoryPtr *pdir)
1450N/A{
1450N/A char file_name[MAXFONTNAMELEN];
1450N/A char font_name[MAXFONTNAMELEN];
1450N/A char dir_file[MAXFONTNAMELEN];
1450N/A FILE *file;
1450N/A int count, i;
1450N/A struct stat statb;
1450N/A
1450N/A FontDirectoryPtr dir = NullFontDirectory;
1450N/A
1450N/A i = strlcpy(dir_file, directory, sizeof(dir_file));
1450N/A if (directory[i - 1] != '/')
1450N/A strlcat(dir_file, "/", sizeof(dir_file));
1450N/A strlcat(dir_file, FontDirFile, sizeof(dir_file));
1450N/A file = fopen(dir_file, "r");
1450N/A if (file) {
1450N/A if (fstat (fileno(file), &statb) == -1)
1450N/A return EBadFontPath;
1450N/A count = fscanf(file, "%d\n", &i);
1450N/A if ((count == EOF) || (count != 1)) {
1450N/A fclose(file);
1450N/A return EBadFontPath;
1450N/A }
1450N/A dir = FontFileMakeDir(directory, i);
1450N/A if (dir == NULL) {
1450N/A fclose(file);
1450N/A return EBadFontPath;
1450N/A }
1450N/A dir->dir_mtime = statb.st_mtime;
1450N/A while ((count = fscanf(file, "%1024s %[^\n]\n", file_name, font_name))
1450N/A != EOF) {
1450N/A if (count != 2) {
1450N/A FontFileFreeDir (dir);
1450N/A fclose(file);
1450N/A return EBadFontPath;
1450N/A }
1450N/A if (!FontFileAddFontFile (dir, font_name, file_name))
1450N/A {
1450N/A FontFileFreeDir (dir);
1450N/A fclose(file);
1450N/A return EBadFontPath;
1450N/A }
1450N/A }
1450N/A fclose(file);
1450N/A } else if (errno != ENOENT) {
1450N/A return EBadFontPath;
1450N/A }
1450N/A if (!dir)
1450N/A return EBadFontPath;
1450N/A
1450N/A *pdir = dir;
1450N/A return Success;
1450N/A}
1450N/A
1450N/A#define NAME 0
1450N/A#define NEWLINE 1
1450N/A#define DONE 2
1450N/A#define EALLOC 3
1450N/A#define FileClosed 4
1450N/A
1450N/A#define QUOTE 0
1450N/A#define WHITE 1
1450N/A#define NORMAL 2
1450N/A#define END 3
1450N/A#define NL 4
1450N/A
1450N/Astatic int charClass;
1450N/A
1450N/Astatic int
1450N/AlexAlias(
1450N/A FILE *file,
1450N/A char **lexToken)
1450N/A{
1450N/A int c;
1450N/A char *t;
1450N/A enum state {
1450N/A Begin, Normal, Quoted
1450N/A } state;
1450N/A int count;
1450N/A
1450N/A static char *tokenBuf = (char *) NULL;
1450N/A static unsigned int tokenSize = 0;
1450N/A
1450N/A t = tokenBuf;
1450N/A count = 0;
1450N/A state = Begin;
1450N/A for (;;) {
1450N/A if (count == tokenSize) {
1450N/A unsigned int nsize;
1450N/A char *nbuf;
1450N/A
1450N/A nsize = tokenSize ? (tokenSize << 1) : 64;
1450N/A nbuf = realloc(tokenBuf, nsize);
1450N/A if (!nbuf)
1450N/A return EALLOC;
1450N/A tokenBuf = nbuf;
1450N/A tokenSize = nsize;
1450N/A t = tokenBuf + count;
1450N/A }
1450N/A c = lexc(file);
1450N/A switch (charClass) {
1450N/A case QUOTE:
1450N/A switch (state) {
1450N/A case Begin:
1450N/A case Normal:
1450N/A state = Quoted;
1450N/A break;
1450N/A case Quoted:
1450N/A state = Normal;
1450N/A break;
1450N/A }
1450N/A break;
1450N/A case WHITE:
1450N/A switch (state) {
1450N/A case Begin:
1450N/A continue;
1450N/A case Normal:
1450N/A *t = '\0';
1450N/A *lexToken = tokenBuf;
1450N/A return NAME;
1450N/A case Quoted:
1450N/A break;
1450N/A }
1450N/A /* fall through */
1450N/A case NORMAL:
1450N/A switch (state) {
1450N/A case Begin:
1450N/A state = Normal;
1450N/A }
1450N/A *t++ = c;
1450N/A ++count;
1450N/A break;
1450N/A case END:
1450N/A case NL:
1450N/A switch (state) {
1450N/A case Begin:
1450N/A *lexToken = (char *) NULL;
1450N/A return charClass == END ? DONE : NEWLINE;
1450N/A default:
1450N/A *t = '\0';
1450N/A *lexToken = tokenBuf;
1450N/A ungetc(c, file);
1450N/A return NAME;
1450N/A }
1450N/A }
1450N/A }
1450N/A}
1450N/A
1450N/Astatic int
1450N/Alexc(FILE *file)
1450N/A{
1450N/A int c;
1450N/A
1450N/A c = getc(file);
1450N/A switch (c) {
1450N/A case EOF:
1450N/A charClass = END;
1450N/A break;
1450N/A case '\\':
1450N/A c = getc(file);
1450N/A if (c == EOF)
1450N/A charClass = END;
1450N/A else
1450N/A charClass = NORMAL;
1450N/A break;
1450N/A case '"':
1450N/A charClass = QUOTE;
1450N/A break;
1450N/A case ' ':
1450N/A case '\t':
1450N/A charClass = WHITE;
1450N/A break;
1450N/A case '\n':
1450N/A charClass = NL;
1450N/A break;
1450N/A default:
1450N/A charClass = NORMAL;
1450N/A break;
1450N/A }
1450N/A return c;
1450N/A}
1450N/A
1450N/Astatic inline unsigned char
1450N/AISOLatin1ToLower(unsigned char source)
1450N/A{
1450N/A if (source >= XK_A && source <= XK_Z)
1450N/A return source + (XK_a - XK_A);
1450N/A if (source >= XK_Agrave && source <= XK_Odiaeresis)
1450N/A return source + (XK_agrave - XK_Agrave);
1450N/A if (source >= XK_Ooblique && source <= XK_Thorn)
1450N/A return source + (XK_oslash - XK_Ooblique);
1450N/A return source;
1450N/A}
1450N/A
1450N/Astatic void
1450N/AcopyISOLatin1Lowered(char *dest, char *source, int length)
1450N/A{
1450N/A int i;
1450N/A for (i = 0; i < length; i++, source++, dest++)
1450N/A *dest = ISOLatin1ToLower(*source);
1450N/A *dest = '\0';
1450N/A}
1450N/A
1450N/Astatic int
1450N/AReadAliases(
1450N/A FILE *file,
1450N/A char *alias,
1450N/A char *font_name)
1450N/A{
1450N/A int token;
1450N/A char *lexToken;
1450N/A int status = Success;
1450N/A
1450N/A while (status == Success) {
1450N/A token = lexAlias(file, &lexToken);
1450N/A switch (token) {
1450N/A case NEWLINE:
1450N/A break;
1450N/A case DONE:
1450N/A fclose(file);
1450N/A return FileClosed;
1450N/A case EALLOC:
1450N/A status = EAllocError;
1450N/A break;
1450N/A case NAME:
1450N/A strlcpy(alias, lexToken, MAXFONTNAMELEN);
1450N/A token = lexAlias(file, &lexToken);
1450N/A switch (token) {
1450N/A case NEWLINE:
1450N/A break;
1450N/A case DONE:
1450N/A status = EBadFontPath;
1450N/A break;
1450N/A case EALLOC:
1450N/A status = EAllocError;
1450N/A break;
1450N/A case NAME:
1450N/A copyISOLatin1Lowered(alias, alias, strlen(alias));
1450N/A copyISOLatin1Lowered(font_name, lexToken, strlen(lexToken));
1450N/A return status;
1450N/A }
1450N/A }
1450N/A }
1450N/A fclose(file);
1450N/A return FileClosed;
1450N/A}
1450N/A
1450N/A#define FontAliasEntry 8
1450N/A
1450N/Astatic int
1450N/AOpenAndVerifyFont (
1450N/A char *name,
1450N/A int namelen,
1450N/A FontDirectoryPtr dir)
1450N/A{
1450N/A char lowerName[MAXFONTNAMELEN];
1450N/A char *p;
1450N/A FontNameRec tmpName;
1450N/A FontEntryPtr entry;
1450N/A FontScalableRec vals;
1450N/A FontBitmapEntryPtr bitmap;
1450N/A FontBCEntryPtr bc;
1450N/A int ret = 0;
1450N/A Bool isxlfd;
1450N/A Bool scaleAlias;
1450N/A
1450N/A if (namelen >= MAXFONTNAMELEN)
1450N/A return EAllocError;
1450N/A copyISOLatin1Lowered (lowerName, name, namelen);
1450N/A lowerName[namelen] = '\0';
1450N/A tmpName.name = lowerName;
1450N/A tmpName.length = namelen;
1450N/A tmpName.ndashes = FontFileCountDashes (lowerName, namelen);
1450N/A /* Match XLFD patterns */
1450N/A if (tmpName.ndashes == 14 &&
1450N/A FontParseXLFDName (lowerName, &vals, FONT_XLFD_REPLACE_ZERO))
1450N/A {
1450N/A isxlfd = TRUE;
1450N/A tmpName.length = strlen (lowerName);
1450N/A entry = FontFileFindNameInDir (&dir->scalable, &tmpName);
1450N/A if (entry) {
1450N/A return Success;
1450N/A }
1450N/A }
1450N/A else
1450N/A {
1450N/A isxlfd = FALSE;
1450N/A }
1450N/A /* Match non XLFD pattern */
1450N/A if (entry = FontFileFindNameInDir (&dir->nonScalable, &tmpName))
1450N/A {
1450N/A switch (entry->type) {
1450N/A case FONT_ENTRY_BITMAP:
1450N/A bitmap = &entry->u.bitmap;
1450N/A ret = Success;
1450N/A break;
1450N/A case FONT_ENTRY_ALIAS:
1450N/A if (entry->u.alias.resolved) {
1450N/A strlcpy(name, entry->u.alias.resolved, MAXFONTNAMELEN);
1450N/A ret = FontAliasEntry;
1450N/A } else {
1450N/A ret = EBadFontName;
1450N/A }
1450N/A break;
1450N/A case FONT_ENTRY_BC:
1450N/A bc = &entry->u.bc;
1450N/A entry = bc->entry;
1450N/A break;
1450N/A default:
1450N/A ret = EBadFontName;
1450N/A }
1450N/A }
1450N/A else
1450N/A {
1450N/A scaleAlias = FALSE;
1450N/A if (isxlfd)
1450N/A {
1450N/A FontParseXLFDName(lowerName, &vals, FONT_XLFD_REPLACE_ZERO);
1450N/A tmpName.length = strlen (lowerName);
1450N/A scaleAlias = TRUE;
1450N/A }
1450N/A else
1450N/A {
1450N/A p = lowerName + tmpName.length;
1450N/A while (p > lowerName && isdigit(p[-1]))
1450N/A p--;
1450N/A if (*p)
1450N/A {
1450N/A vals.point = atoi(p) * 10;
1450N/A if (p[-1] == '-')
1450N/A p--;
1450N/A if (p > lowerName)
1450N/A {
1450N/A *p = '\0';
1450N/A vals.pixel = 0;
1450N/A vals.x = 0;
1450N/A vals.y = 0;
1450N/A vals.width = 0;
1450N/A tmpName.length = p - lowerName;
1450N/A scaleAlias = TRUE;
1450N/A }
1450N/A }
1450N/A }
1450N/A if (scaleAlias &&
1450N/A (entry = FontFileFindNameInDir (&dir->nonScalable, &tmpName)) &&
1450N/A entry->type == FONT_ENTRY_ALIAS)
1450N/A {
1450N/A if (entry->u.alias.resolved) {
1450N/A strlcpy(name, entry->u.alias.resolved, MAXFONTNAMELEN);
1450N/A return FontAliasEntry;
1450N/A } else {
1450N/A return EBadFontName;
1450N/A }
1450N/A
1450N/A }
1450N/A else
1450N/A {
1450N/A ret = EBadFontName;
1450N/A }
1450N/A }
1450N/A return ret;
1450N/A}
1450N/A
1450N/A#define TempFileSuffix "_TMPFILE"
1450N/A
1450N/Astatic void
1450N/AProcessAliasFile(
1450N/A FontDirectoryPtr dir,
1450N/A const char *aliasfilename)
1450N/A{
1450N/A char alias[MAXFONTNAMELEN];
1450N/A char font_name[MAXFONTNAMELEN];
1450N/A char save_font_name[MAXFONTNAMELEN];
1450N/A char aliasfile[MAXFONTNAMELEN];
1450N/A char tmpfile[MAXFONTNAMELEN];
1450N/A char outfile[MAXFONTNAMELEN];
1450N/A
1450N/A FILE *file, *newfile;
1450N/A int ret;
1450N/A struct stat statb;
1450N/A int retvalue;
1450N/A int containsSpace = 0;
1450N/A
1450N/A strlcpy(aliasfile, dir->directory, sizeof(aliasfile));
1450N/A strlcat(aliasfile, aliasfilename, sizeof(aliasfile));
1450N/A file = fopen(aliasfile, "r");
1450N/A if (!file)
1450N/A return; /* fail silently -- if no alias file, we're done */
1450N/A else
1450N/A if (fstat (fileno(file), &statb) == -1)
1450N/A return;
1450N/A
1450N/A strlcpy(tmpfile, aliasfile, sizeof(tmpfile));
1450N/A strlcat(tmpfile, TempFileSuffix, sizeof(tmpfile));
1450N/A newfile = fopen(tmpfile, "w");
1450N/A
1450N/A if (!newfile) {
1450N/A ErrorF("Can't create new alias file %s\n", tmpfile);
1450N/A return;
1450N/A }
1450N/A
1450N/A while ((ret = ReadAliases(file, alias, font_name)) != FileClosed) {
1450N/A strlcpy(save_font_name, font_name, sizeof(save_font_name));
1450N/A while ((retvalue = OpenAndVerifyFont(font_name,strlen(font_name), dir))
1450N/A == FontAliasEntry) {
1450N/A continue;
1450N/A }
1450N/A if (strcmp(alias,save_font_name) == 0) {
1450N/A /* 4258475: don't add if the names are the same */
1450N/A#ifdef DEBUG
1450N/A fprintf(stderr,"%s\t%s aliased to itself!\n", alias, save_font_name);
1450N/A#endif
1450N/A } else if (retvalue == Success) {
1450N/A /* add this alias to list of known aliases */
1450N/A if (strchr(alias, ' '))
1450N/A containsSpace = 1;
1450N/A
1450N/A if (!FontFileAddFontAlias (dir, alias, save_font_name))
1450N/A#ifdef DEBUG
1450N/A fprintf(stderr, "installalias: unable to add alias to list\n");
1450N/A#else
1450N/A ; /* do nothing -- fail silently */
1450N/A#endif /* DEBUG */
1450N/A if (containsSpace) {
1450N/A containsSpace = 0;
1450N/A fprintf(newfile, "\"%s\"\t\"%s\"\n",alias, save_font_name);
1450N/A } else {
1450N/A fprintf(newfile, "%s\t\"%s\"\n",alias, save_font_name);
1450N/A }
1450N/A }
1450N/A#ifdef DEBUG
1450N/A else
1450N/A fprintf(stderr,"%s\t%s not found\n", alias, save_font_name);
1450N/A#endif /* DEBUG */
1450N/A }
1450N/A fclose(newfile);
1450N/A fclose(file);
1450N/A strlcpy(outfile, dir->directory, sizeof(outfile));
1450N/A strlcat(outfile, "fonts.alias", sizeof(outfile));
1450N/A ret = rename(tmpfile, outfile);
1450N/A if (ret < 0) {
1450N/A ErrorF("Unable to rename %s to %s.\n", tmpfile, outfile);
1450N/A }
1450N/A return;
1450N/A}
1450N/A
1450N/Aint
1450N/AGetDefaultPointSize (void)
1450N/A{
1450N/A return 120;
1450N/A}
1450N/A
1450N/A/* ARGSUSED */
1450N/AFontResolutionPtr GetClientResolutions (int *num)
1450N/A{
1450N/A return 0;
1450N/A}
1450N/A
1450N/A/* ARGSUSED */
1450N/Aint RegisterFPEFunctions ( NameCheckFunc name_func,
1450N/A InitFpeFunc init_func,
1450N/A FreeFpeFunc free_func,
1450N/A ResetFpeFunc reset_func,
1450N/A OpenFontFunc open_func,
1450N/A CloseFontFunc close_func,
1450N/A ListFontsFunc list_func,
1450N/A StartLfwiFunc start_lfwi_func,
1450N/A NextLfwiFunc next_lfwi_func,
1450N/A WakeupFpeFunc wakeup_func,
1450N/A ClientDiedFunc client_died,
1450N/A LoadGlyphsFunc load_glyphs,
1450N/A StartLaFunc start_list_alias_func,
1450N/A NextLaFunc next_list_alias_func,
1450N/A SetPathFunc set_path_func )
1450N/A{
1450N/A return 0;
1450N/A}
1450N/A
1450N/Avoid
1450N/AInitFontFileFunctions(void)
1450N/A{
1450N/A FontFileRegisterFpeFunctions();
1450N/A PseudoFontFileRegisterFpeFunctions();
1450N/A return;
1450N/A}
1450N/A
1450N/Aint
1450N/Amain(int argc, char **argv)
1450N/A{
1450N/A
1450N/A FontDirectoryPtr dir;
1450N/A const char *aliasFileName = "fonts.alias";
1450N/A char *defaultDirectoryList[] = { ".", NULL };
1450N/A char **directoryList = defaultDirectoryList;
1450N/A int directoryCount = 1;
1450N/A int i = 0, ret;
1450N/A
1450N/A programName = argv[0];
1450N/A
1450N/A InitFontFileFunctions();
1450N/A
1450N/A if (argc > 1) {
1450N/A aliasFileName = argv[1];
1450N/A }
1450N/A
1450N/A if (argc > 2) {
1450N/A directoryCount = argc;
1450N/A directoryList = argv;
1450N/A i = 2;
1450N/A }
1450N/A
1450N/A for (/* i initialized above */ ; i < directoryCount; i++) {
1450N/A ret = ProcessFontsDirectory(directoryList[i], &dir);
1450N/A if (ret == Success) {
1450N/A ProcessAliasFile(dir, aliasFileName);
1450N/A } else {
1450N/A char curdir[PATH_MAX];
1450N/A const char *directory = directoryList[i];
1450N/A if (strcmp(directory, ".") == 0) {
1450N/A getcwd(curdir, sizeof(curdir));
1450N/A directory = curdir;
1450N/A }
1450N/A ErrorF("failed to process fonts.dir file in %s\n", directory);
1450N/A exit (1);
1450N/A }
1450N/A }
1450N/A exit (0);
1450N/A}
1450N/A