Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2000:
[Freeciv-Dev] bug/fix: --debug 4:foo without DEBUG (PR#556)
Home

[Freeciv-Dev] bug/fix: --debug 4:foo without DEBUG (PR#556)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] bug/fix: --debug 4:foo without DEBUG (PR#556)
From: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Date: Sun, 10 Sep 2000 23:32:21 -0700 (PDT)

I noticed that if you compile without DEBUG defined,
log_parse_level_str() doesn't complain as it should about 
"--debug 4:foo" (though it does correctly for plain "--debug 4").

Fixed by attached patch.

-- David
--- freeciv-cvs/common/log.c    Tue Aug  8 22:24:03 2000
+++ fc-adv/common/log.c Mon Sep 11 15:33:17 2000
@@ -90,8 +90,13 @@
   }
 
   c = level_str;
-  if (c[0] == '4' && c[1] == ':') {
-    level = 4;
+  if (c[0] == ('0' + LOG_DEBUG) && c[1] == ':') {
+    level = LOG_DEBUG;
+    if (max_level < LOG_DEBUG) {
+      fprintf(stderr, _("Freeciv must be compiled with the DEBUG flag"
+                       " to use debug level %d.\n"), LOG_DEBUG);
+      return -1;
+    }
   } else {
     fprintf(stderr, _("Badly formed log level argument \"%s\".\n"), level_str);
     return -1;

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] bug/fix: --debug 4:foo without DEBUG (PR#556), David Pfitzner <=