diff options
author | marha <marha@users.sourceforge.net> | 2009-09-24 10:49:08 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-09-24 10:49:08 +0000 |
commit | 67b353c9ce039b254ba2e92cd6f842c505a8bd21 (patch) | |
tree | edb5f3ff6a9564a50f3b701913ab2b3aafa80a95 /xorg-server/dix/dixfonts.c | |
parent | f3d88db0960f1c23e55f2529764b096ac92d78d9 (diff) | |
download | vcxsrv-67b353c9ce039b254ba2e92cd6f842c505a8bd21.tar.gz vcxsrv-67b353c9ce039b254ba2e92cd6f842c505a8bd21.tar.bz2 vcxsrv-67b353c9ce039b254ba2e92cd6f842c505a8bd21.zip |
Update following packages:
- xproto-7.0.16
- libXdmcp-1.0.3
- bdftopcf-1.0.2
- xorg-server-1.6.99.902
Diffstat (limited to 'xorg-server/dix/dixfonts.c')
-rw-r--r-- | xorg-server/dix/dixfonts.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/xorg-server/dix/dixfonts.c b/xorg-server/dix/dixfonts.c index 7d7ae71de..d0a46c744 100644 --- a/xorg-server/dix/dixfonts.c +++ b/xorg-server/dix/dixfonts.c @@ -1810,6 +1810,9 @@ SetFontPath(ClientPtr client, int npaths, unsigned char *paths, int *error) int SetDefaultFontPath(char *path) { + char *temp_path, + *start, + *end; unsigned char *cp, *pp, *nump, @@ -1820,12 +1823,31 @@ SetDefaultFontPath(char *path) size = 0, bad; + /* ensure temp_path contains "built-ins" */ + start = path; + 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) { + temp_path = Xprintf("%s%sbuilt-ins", path, *path ? "," : ""); + } else { + temp_path = Xstrdup(path); + } + if (!temp_path) + return BadAlloc; + /* get enough for string, plus values -- use up commas */ - len = strlen(path) + 1; + len = strlen(temp_path) + 1; nump = cp = newpath = xalloc(len); if (!newpath) return BadAlloc; - pp = (unsigned char *) path; + pp = (unsigned char *) temp_path; cp++; while (*pp) { if (*pp == ',') { @@ -1844,6 +1866,7 @@ SetDefaultFontPath(char *path) err = SetFontPathElements(num, newpath, &bad, TRUE); xfree(newpath); + xfree(temp_path); return err; } |