diff options
author | Ulrich Sibiller <uli42@gmx.de> | 2019-04-23 20:08:57 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2019-05-10 16:24:03 +0200 |
commit | 0086b8c2469fbf19a337f38f5431bd77da045332 (patch) | |
tree | 4c20e2cfb4a300baef9fe46db5235a01296b91ca | |
parent | 78a16245a4bbf13acf53768064d81cbaa28c0d8b (diff) | |
download | nx-libs-0086b8c2469fbf19a337f38f5431bd77da045332.tar.gz nx-libs-0086b8c2469fbf19a337f38f5431bd77da045332.tar.bz2 nx-libs-0086b8c2469fbf19a337f38f5431bd77da045332.zip |
Font.c: Avoid duplicate font paths
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Font.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.c b/nx-X11/programs/Xserver/hw/nxagent/Font.c index 89128d4c1..11496938c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Font.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Font.c @@ -1497,12 +1497,36 @@ void nxagentVerifyDefaultFontPath(void) for (int i = 0; ; i++) { - char *dir = nxagentFontDirs[i]; + int j; + const char *dir = nxagentFontDirs[i]; if (dir == NULL) + { break; + } else - nxagentVerifySingleFontPath(&fontPath, dir); + { + for (j = 0; j <= i; j++) + { + //if (strcmp(nxagentFontDirs[j], dir) == 0) + if (nxagentFontDirs[j] == dir) + { + break; + } + } + + if (j == i) + { + nxagentVerifySingleFontPath(&fontPath, dir); + } +#ifdef TEST + else + { + fprintf(stderr, "%s: Skipping duplicate font dir [%s].\n", __func__, + validateString(dir)); + } +#endif + } } if (*fontPath == '\0') |