Author: cazfi
Date: Mon Feb 29 12:50:42 2016
New Revision: 32134

URL: http://svn.gna.org/viewcvs/freeciv?rev=32134&view=rev
Log:
Client passes deprecation warnings commandline parameter to forked server, if 
it itself has
been started with one.

See patch #7005

Modified:
    trunk/client/connectdlg_common.c

Modified: trunk/client/connectdlg_common.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/connectdlg_common.c?rev=32134&r1=32133&r2=32134&view=diff
==============================================================================
--- trunk/client/connectdlg_common.c    (original)
+++ trunk/client/connectdlg_common.c    Mon Feb 29 12:50:42 2016
@@ -41,6 +41,7 @@
 /* utility */
 #include "astring.h"
 #include "capability.h"
+#include "deprecations.h"
 #include "fciconv.h"
 #include "fcintl.h"
 #include "ioz.h"
@@ -204,6 +205,7 @@
   char savesdir[MAX_LEN_PATH];
   char scensdir[MAX_LEN_PATH];
   char options[512];
+  char *depr;
 #ifdef DEBUG
   char cmdline1[512];
   char cmdline2[512];
@@ -247,7 +249,7 @@
 #ifdef HAVE_USABLE_FORK
   {
     int argc = 0;
-    const int max_nargs = 22;
+    const int max_nargs = 23;
     char *argv[max_nargs + 1], port_buf[32];
 
     /* Set up the command-line parameters. */
@@ -280,6 +282,9 @@
       argv[argc++] = "--file";
       argv[argc++] = savefile;
     }
+    if (are_deprecation_warnings_enabled()) {
+      argv[argc++] = "--warnings";
+    }
     argv[argc] = NULL;
     fc_assert(argc <= max_nargs);
 
@@ -397,11 +402,17 @@
   interpret_tilde(scensdir, sizeof(scensdir), "~/.freeciv/scenarios");
   internal_to_local_string_buffer(scensdir, scenscmdline, 
sizeof(scenscmdline));
 
+  if (are_deprecation_warnings_enabled()) {
+    depr = " --warnings";
+  } else {
+    depr = "";
+  }
+
   fc_snprintf(options, sizeof(options),
               "-p %d --bind localhost -q 1 -e%s%s%s --saves \"%s\" "
-              "--scenarios \"%s\" -A none",
+              "--scenarios \"%s\" -A none %s",
               internal_server_port, logcmdline, scriptcmdline, savefilecmdline,
-              savescmdline, scenscmdline);
+              savescmdline, scenscmdline, depr);
 #ifdef DEBUG
   fc_snprintf(cmdline1, sizeof(cmdline1), "./fcser %s", options);
   fc_snprintf(cmdline2, sizeof(cmdline2),


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to