[X2Go-Commits] [nx-libs] 08/219: Font.c: Let dix check if a font path exists

git-admin at x2go.org git-admin at x2go.org
Sat Sep 28 12:10:11 CEST 2019


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch 3.6.x
in repository nx-libs.

commit dfb5602a662507373321a1b1497311027dafdc93
Author: Ulrich Sibiller <uli42 at gmx.de>
Date:   Tue Apr 23 19:21:41 2019 +0200

    Font.c: Let dix check if a font path exists
    
    Dix will only add font paths that are existing on the system. There's no need
    to check that ourselves.
---
 nx-X11/programs/Xserver/hw/nxagent/Font.c | 54 ++++++++++++++-----------------
 1 file changed, 24 insertions(+), 30 deletions(-)

diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.c b/nx-X11/programs/Xserver/hw/nxagent/Font.c
index 8c1cb7269..6fb6c8f35 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Font.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Font.c
@@ -1433,45 +1433,39 @@ static Bool nxagentGetFontServerPath(char * fontServerPath, int size)
 
 void nxagentVerifySingleFontPath(char **dest, const char *fontDir)
 {
-  struct stat dirStat;
-
   if (!dest || !*dest)
     return;
 
-  if (stat(fontDir, &dirStat) == 0 &&
-          S_ISDIR(dirStat.st_mode) != 0)
-  {
-    #ifdef TEST
-    fprintf(stderr, "%s: Assuming fonts in directory [%s].\n", __func__,
-                validateString(fontDir));
-    #endif
+  #ifdef TEST
+  fprintf(stderr, "%s: Assuming fonts in directory [%s].\n", __func__,
+	  validateString(fontDir));
+  #endif
 
-    for (int i = 0; ; i++)
-    {
-      char *tmppath = NULL;
-      int rc;
+  for (int i = 0; ; i++)
+  {
+    char *tmppath = NULL;
+    int rc;
 
-      const char *subdir = nxagentFontSubdirs[i];
+    const char *subdir = nxagentFontSubdirs[i];
 
-      if (subdir == NULL)
-        return;
+    if (subdir == NULL)
+      return;
 
-      if (**dest != '\0')
-      {
-        rc = asprintf(&tmppath, "%s,%s/%s", *dest, fontDir, subdir);
-      }
-      else
-      {
-        rc = asprintf(&tmppath, "%s/%s", fontDir, subdir);
-      }
+    if (**dest != '\0')
+    {
+      rc = asprintf(&tmppath, "%s,%s/%s", *dest, fontDir, subdir);
+    }
+    else
+    {
+      rc = asprintf(&tmppath, "%s/%s", fontDir, subdir);
+    }
 
-      if (rc == -1)
-        return;
+    if (rc == -1)
+      return;
 
-      free(*dest);
-      *dest = tmppath;
-      tmppath = NULL;
-    }
+    free(*dest);
+    *dest = tmppath;
+    tmppath = NULL;
   }
 }
 

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git


More information about the x2go-commits mailing list