aboutsummaryrefslogtreecommitdiff
path: root/nx-X11
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2020-01-19 12:42:31 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-05-07 14:57:15 +0200
commitc135bbcfea95d7468c18a672266c98dffde8597f (patch)
tree882dc56e40d1e739e0c0f8c17ab61449cc56b102 /nx-X11
parent8199ec319f9bebc2a2407d6e5d38f87943b3382c (diff)
downloadnx-libs-c135bbcfea95d7468c18a672266c98dffde8597f.tar.gz
nx-libs-c135bbcfea95d7468c18a672266c98dffde8597f.tar.bz2
nx-libs-c135bbcfea95d7468c18a672266c98dffde8597f.zip
NXdixfonts.c: call dix version of SetDefaultFontPath
Diffstat (limited to 'nx-X11')
-rw-r--r--nx-X11/programs/Xserver/dix/dixfonts.c6
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c73
2 files changed, 6 insertions, 73 deletions
diff --git a/nx-X11/programs/Xserver/dix/dixfonts.c b/nx-X11/programs/Xserver/dix/dixfonts.c
index f1fa53f69..e3e90b163 100644
--- a/nx-X11/programs/Xserver/dix/dixfonts.c
+++ b/nx-X11/programs/Xserver/dix/dixfonts.c
@@ -1958,9 +1958,12 @@ SetFontPath(ClientPtr client, int npaths, unsigned char *paths)
return err;
}
-#ifndef NXAGENT_SERVER
int
+#ifdef NXAGENT_SERVER
+xorg_SetDefaultFontPath(char *path)
+#else
SetDefaultFontPath(char *path)
+#endif
{
char *temp_path,
*start,
@@ -2027,7 +2030,6 @@ SetDefaultFontPath(char *path)
return err;
}
-#endif /* NXAGENT_SERVER */
unsigned char *
GetFontPath(int *count, int *length)
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c
index 992a6674f..2204ca60d 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c
@@ -99,7 +99,7 @@ char _NXFontPath[NXFONTPATHLENGTH];
* the NX_FONT environment.
*/
-static const char *_NXGetFontPath(const char *path)
+static char *_NXGetFontPath(const char *path)
{
/*
* Check the environment only once.
@@ -982,78 +982,9 @@ bail:
int
SetDefaultFontPath(char *path)
{
- char *temp_path,
- *start,
- *end;
- unsigned char *cp,
- *pp,
- *nump,
- *newpath;
- int num = 1,
- len,
- err,
- size = 0,
- bad;
-
-#ifdef NXAGENT_SERVER
- path = (char *) _NXGetFontPath(path);
-#endif /* NXAGENT_SERVER */
-
- start = path;
-
- /* ensure temp_path contains "built-ins" */
- while (1) {
- start = strstr(start, "built-ins");
- if (start == NULL)
- break;
- end = start + strlen("built-ins");
- if ((start == path || start[-1] == ',') && (!*end || *end == ','))
- break;
- start = end;
- }
- if (!start) {
- if (asprintf(&temp_path, "%s%sbuilt-ins", path, *path ? "," : "")
- == -1)
- temp_path = NULL;
- }
- else {
- temp_path = strdup(path);
- }
- if (!temp_path)
- return BadAlloc;
-
- /* get enough for string, plus values -- use up commas */
- len = strlen(temp_path) + 1;
- nump = cp = newpath = (unsigned char *) malloc(len);
- if (!newpath) {
- free(temp_path);
- return BadAlloc;
- }
- pp = (unsigned char *) temp_path;
- cp++;
- while (*pp) {
- if (*pp == ',') {
- *nump = (unsigned char) size;
- nump = cp++;
- pp++;
- num++;
- size = 0;
- } else {
- *cp++ = *pp++;
- size++;
- }
- }
- *nump = (unsigned char) size;
-
- err = SetFontPathElements(num, newpath, &bad, TRUE);
-
- free(newpath);
- free(temp_path);
-
- return err;
+ return xorg_SetDefaultFontPath(_NXGetFontPath(path));
}
-
typedef struct
{
LFclosurePtr c;