summaryrefslogtreecommitdiff
path: root/games/sjeng/patches/patch-ad
diff options
context:
space:
mode:
Diffstat (limited to 'games/sjeng/patches/patch-ad')
-rw-r--r--games/sjeng/patches/patch-ad36
1 files changed, 36 insertions, 0 deletions
diff --git a/games/sjeng/patches/patch-ad b/games/sjeng/patches/patch-ad
new file mode 100644
index 00000000000..6849d22432a
--- /dev/null
+++ b/games/sjeng/patches/patch-ad
@@ -0,0 +1,36 @@
+$NetBSD: patch-ad,v 1.1.1.1 2001/10/25 04:42:52 jlam Exp $
+
+--- rcfile.c.orig Fri Jun 15 06:47:10 2001
++++ rcfile.c
+@@ -47,12 +47,30 @@
+ int cfg_attackeval;
+ float cfg_scalefac;
+
++static
++FILE *get_rcfile (void)
++{
++ FILE *rc;
++ char buf[STR_BUFF];
++
++ sprintf (buf, "%s/.sjengrc", getenv ("HOME"));
++ if ((rc = fopen ("sjeng.rc", "r")) != NULL) {
++ return rc;
++ } else if ((rc = fopen (".sjengrc", "r")) != NULL) {
++ return rc;
++ } else if ((rc = fopen (buf, "r")) != NULL) {
++ return rc;
++ } else {
++ return NULL;
++ }
++}
++
+ void read_rcfile (void)
+ {
+ int i;
+ unsigned int setc;
+
+- if ((rcfile = fopen ("sjeng.rc", "r")) == NULL)
++ if ((rcfile = get_rcfile ()) == NULL)
+ {
+ printf("No configuration file!\n");
+