Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2005:
[Freeciv-Dev] (PR#12756) Improving error message in inputfile
Home

[Freeciv-Dev] (PR#12756) Improving error message in inputfile

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#12756) Improving error message in inputfile
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Sun, 10 Apr 2005 02:22:40 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12756 >

"1: Did not find required token: entry_name"

Patch changes this to the more helpful:

"1: Did not find token entry_name in data/default/effects.ruleset line 71"

Now it is possible to make a mistake in a ruleset without tearing your
hair out.

  - Per

Index: utility/inputfile.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/utility/inputfile.c,v
retrieving revision 1.35
diff -u -r1.35 inputfile.c
--- utility/inputfile.c 4 Apr 2003 15:47:49 -0000       1.35
+++ utility/inputfile.c 10 Apr 2005 09:21:24 -0000
@@ -608,15 +608,8 @@
       freelog(LOG_DEBUG, "inputfile: found %s '%s'", name, inf->token.str);
     }
   } else {
-    if (!required) {
-      if (INF_DEBUG_NOT_FOUND) {
-       freelog(LOG_DEBUG, "inputfile: did not find %s", name);
-      }
-    } else {
-      /* should be varargs... */
-      freelog(LOG_ERROR, "Did not find required token: %s", name);
-      return NULL;
-    }
+    freelog(LOG_ERROR, "Did not find token %s in %s line %d", 
+            name, inf->filename, inf->line_num);
   }
   return c;
 }

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#12756) Improving error message in inputfile, Per I. Mathisen <=