pkgsrc/fonts/chkfontpath/patches/patch-ab
hubertf a1a2016124 Import chkfontpath-1.9.7: Command line tool to manage X server's font path
This is a simple terminal mode program for configuring the directories
in the X font server's path. It is mostly intended to be used
`internally' by RPM when packages with fonts are added or removed, but
it may be useful as a stand-alone utility in some instances.

XXX hey, *I* didn't make this up... of course xset would have done the
XXX job just well, but now programs (openoffice 1.1.0) want to call this,
XXX what can we do. :(
2003-10-03 18:20:40 +00:00

49 lines
1.5 KiB
Text

$NetBSD: patch-ab,v 1.1.1.1 2003/10/03 18:20:40 hubertf Exp $
--- chkfontpath.c.orig Thu Jan 18 22:27:13 2001
+++ chkfontpath.c
@@ -44,7 +44,7 @@ void readFontPath()
int catFlag = 0;
int noFirstLine = 0;
- f = fopen("/etc/X11/fs/config", "r");
+ f = fopen(X11BASE "/lib/X11/fs/config", "r");
if (!f) {
if (!quiet) {
fprintf(stderr, "%s: error opening /etc/X11/fs/config\n", progName);
@@ -136,9 +136,9 @@ void writeNewConfig()
int catFlag = 0, i;
struct stat sb;
- stat("/etc/X11/fs/config", &sb);
+ stat(X11BASE "/lib/X11/fs/config", &sb);
- f = fopen("/etc/X11/fs/config", "r");
+ f = fopen(X11BASE "/lib/X11/fs/config", "r");
if (!f) {
if (!quiet) {
fprintf(stderr, "%s: error opening /etc/X11/fs/config for reading\n",
@@ -147,7 +147,7 @@ void writeNewConfig()
} else
exit(0);
}
- f1 = fopen("/etc/X11/fs/config-", "w");
+ f1 = fopen(X11BASE "/lib/X11/fs/config-", "w");
if (!f1) {
if (!quiet) {
fprintf(stderr, "%s: error opening /etc/X11/fs/config- for writing\n",
@@ -202,11 +202,11 @@ void writeNewConfig()
fclose(f);
fclose(f1);
- unlink("/etc/X11/fs/config");
- rename("/etc/X11/fs/config-", "/etc/X11/fs/config");
+ unlink(X11BASE "/lib/X11/fs/config");
+ rename(X11BASE "/lib/X11/fs/config-", X11BASE "/lib/X11/fs/config");
/* fix up permissions on the new file */
- chmod("/etc/X11/fs/config", sb.st_mode);
+ chmod(X11BASE "/lib/X11/fs/config", sb.st_mode);
}
void addDir(const char *newDir)