aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2019-04-23 19:34:57 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2019-05-10 16:24:03 +0200
commit898f04e4293ce9cf7fcab810e8b27404cf0b6fde (patch)
treebf6cdaa15a6b99636da91d6692d1e9571a541907 /nx-X11/programs/Xserver
parentdfb5602a662507373321a1b1497311027dafdc93 (diff)
downloadnx-libs-898f04e4293ce9cf7fcab810e8b27404cf0b6fde.tar.gz
nx-libs-898f04e4293ce9cf7fcab810e8b27404cf0b6fde.tar.bz2
nx-libs-898f04e4293ce9cf7fcab810e8b27404cf0b6fde.zip
Font.c: Loop over font paths
drop defines and use an array instead. This way adding further paths can be done much easier.
Diffstat (limited to 'nx-X11/programs/Xserver')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Font.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.c b/nx-X11/programs/Xserver/hw/nxagent/Font.c
index 6fb6c8f35..d5c9f8982 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Font.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Font.c
@@ -71,10 +71,13 @@ is" without express or implied warranty.
#undef TEST
#undef DEBUG
-#define NXAGENT_DEFAULT_FONT_DIR "/usr/share/nx/fonts"
-#define NXAGENT_ALTERNATE_FONT_DIR "/usr/share/X11/fonts"
-#define NXAGENT_ALTERNATE_FONT_DIR_2 "/usr/share/fonts/X11"
-#define NXAGENT_ALTERNATE_FONT_DIR_3 "/usr/X11R6/lib/X11/fonts"
+const char * nxagentFontDirs[] = {
+ "/usr/share/nx/fonts",
+ "/usr/share/X11/fonts",
+ "/usr/share/fonts/X11",
+ "/usr/X11R6/lib/X11/fonts",
+ NULL
+};
const char * nxagentFontSubdirs[] = {
"Type1",
@@ -1491,10 +1494,15 @@ void nxagentVerifyDefaultFontPath(void)
return;
}
- nxagentVerifySingleFontPath(&fontPath, NXAGENT_DEFAULT_FONT_DIR);
- nxagentVerifySingleFontPath(&fontPath, NXAGENT_ALTERNATE_FONT_DIR);
- nxagentVerifySingleFontPath(&fontPath, NXAGENT_ALTERNATE_FONT_DIR_2);
- nxagentVerifySingleFontPath(&fontPath, NXAGENT_ALTERNATE_FONT_DIR_3);
+ for (int i = 0; ; i++)
+ {
+ char *dir = nxagentFontDirs[i];
+
+ if (dir == NULL)
+ break;
+ else
+ nxagentVerifySingleFontPath(&fontPath, dir);
+ }
if (*fontPath == '\0')
{