diff options
author | Adam Jackson <ajax@nwnk.net> | 2006-04-03 22:00:06 +0000 |
---|---|---|
committer | Adam Jackson <ajax@nwnk.net> | 2006-04-03 22:00:06 +0000 |
commit | 14af50371c7f23855781924cdf6afa6ab7566a87 (patch) | |
tree | 273e8546d019feb26345a4d2513a9a9e992c701e /hw/xfree86/common/xf86Config.c | |
parent | 373f9f92566290d979730c09c9c5c5d50e23390c (diff) |
Bug #2142: Make font path logging more readable. (Eduard Fuchs)
Diffstat (limited to 'hw/xfree86/common/xf86Config.c')
-rw-r--r-- | hw/xfree86/common/xf86Config.c | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 448f85594..96904c4f9 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -1,4 +1,4 @@ -/* $XdotOrg: xserver/xorg/hw/xfree86/common/xf86Config.c,v 1.22.8.2 2006/02/28 23:55:03 krh Exp $ */ +/* $XdotOrg: xserver/xorg/hw/xfree86/common/xf86Config.c,v 1.23 2006/03/12 00:11:33 krh Exp $ */ /* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v 3.276 2003/10/08 14:58:26 dawes Exp $ */ @@ -666,7 +666,36 @@ configFiles(XF86ConfFilesPtr fileconf) if (! *defaultFontPath) FatalError("No valid FontPath could be found."); - xf86Msg(pathFrom, "FontPath set to \"%s\"\n", defaultFontPath); + /* make fontpath more readable in the logfiles */ + int countDirs = 1; + char *temp_path = defaultFontPath; + while((temp_path = index(temp_path, ',')) != NULL) { + countDirs++; + temp_path++; + } + char *log_buf = xnfalloc(strlen(defaultFontPath) + (2 * countDirs) + 1); + if(!log_buf) /* fallback to old method */ + xf86Msg(pathFrom, "FontPath set to \"%s\"\n", defaultFontPath); + else { + char *start, *end; + int size; + temp_path = log_buf; + start = defaultFontPath; + while((end = index(start, ',')) != NULL) { + size = (end - start) + 1; + *(temp_path++) = '\t'; + strncpy(temp_path, start, size); + temp_path += size; + *(temp_path++) = '\n'; + start += size; + } + /* copy last entry */ + *(temp_path++) = '\t'; + strcpy(temp_path, start); + xf86Msg(pathFrom, "FontPath set to:\n%s\n", log_buf); + xfree(log_buf); + } + /* RgbPath */ |