]> git.pond.sub.org Git - empserver/blobdiff - src/lib/common/conftab.c
Update copyright notice
[empserver] / src / lib / common / conftab.c
index f18d572e2ec1f18db0de1362884f310f7ea14fae..629ce694482805283b7467e3ecc70ecd390163b7 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -26,9 +26,9 @@
  *  ---
  *
  *  conftab.c: Load game configuration files
- * 
+ *
  *  Known contributors to this file:
- *     Markus Armbruster, 2006
+ *     Markus Armbruster, 2006-2008
  */
 
 #include <config.h>
 #include "optlist.h"
 #include "product.h"
 #include "prototypes.h"
+#include "xdump.h"
 
 static int read_custom_table_file(char *);
 
+/*
+ * Read builtin configuration tables.
+ * Return 0 on success, -1 on failure.
+ */
 int
 read_builtin_tables(void)
 {
@@ -56,7 +61,7 @@ read_builtin_tables(void)
      */
     for (ep = empfile; ep->name; ep++) {
        if (!EF_IS_GAME_STATE(ep->uid) && ep->file) {
-           if ((fp = fopen(ep->file, "r")) == NULL) {
+           if ((fp = fopenat(ep->file, "r", builtindir)) == NULL) {
                fprintf(stderr, "Can't open %s for reading (%s)\n",
                        ep->file, strerror(errno));
                return -1;
@@ -107,7 +112,7 @@ read_custom_table_file(char *fname)
     int lineno, res, n;
     FILE *fp;
 
-    if (!(fp = fopen(fname, "r"))) {
+    if (!(fp = fopenat(fname, "r", configdir))) {
        fprintf(stderr, "Can't open config table %s for reading (%s)\n",
                fname, strerror(errno));
        return -1;