[Freeciv-Dev] Re: (PR#3706) append the capstring
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
a better patch:
-mike
diff -Nur -Xsnap/diff_ignore snap/client/civclient.c snap-cap/client/civclient.c
--- snap/client/civclient.c Sat Feb 22 11:43:21 2003
+++ snap-cap/client/civclient.c Wed Mar 12 00:00:19 2003
@@ -196,6 +196,7 @@
/* disallow running as root -- too dangerous */
dont_run_as_root(argv[0], "freeciv_client");
+ init_our_capability();
log_init(logfile, loglevel, NULL);
/* after log_init: */
diff -Nur -Xsnap/diff_ignore snap/common/capstr.c snap-cap/common/capstr.c
--- snap/common/capstr.c Tue Feb 18 09:05:33 2003
+++ snap-cap/common/capstr.c Wed Mar 12 00:33:52 2003
@@ -19,6 +19,7 @@
#include <stdlib.h> /* getenv() */
#include "connection.h" /* MAX_LEN_CAPSTR */
+#include "shared.h"
#include "support.h"
#include "capstr.h"
@@ -120,4 +121,17 @@
s = CAPABILITY;
}
sz_strlcpy(our_capability_internal, s);
+}
+
+/**************************************************************************
+ append the string to the capability string.
+**************************************************************************/
+bool append_capability(const char *str)
+{
+ size_t len;
+
+ sz_strlcat(our_capability_internal, " ");
+ len = mystrlcat(our_capability_internal, str, MAX_LEN_CAPSTR);
+
+ return len < MAX_LEN_CAPSTR;
}
diff -Nur -Xsnap/diff_ignore snap/common/capstr.h snap-cap/common/capstr.h
--- snap/common/capstr.h Thu Jun 10 07:22:15 1999
+++ snap-cap/common/capstr.h Wed Mar 12 00:34:30 2003
@@ -13,8 +13,11 @@
#ifndef FC__CAPSTR_H
#define FC__CAPSTR_H
+#include "shared.h"
+
extern const char * const our_capability;
void init_our_capability(void);
+bool append_capability(const char *str);
#endif
diff -Nur -Xsnap/diff_ignore snap/common/game.c snap-cap/common/game.c
--- snap/common/game.c Sat Feb 22 11:43:42 2003
+++ snap-cap/common/game.c Tue Mar 11 23:59:42 2003
@@ -738,7 +738,6 @@
game.load_options.load_private_map = TRUE;
game.load_options.load_settings = TRUE;
- init_our_capability();
map_init();
idex_init();
diff -Nur -Xsnap/diff_ignore snap/server/srv_main.c snap-cap/server/srv_main.c
--- snap/server/srv_main.c Wed Feb 12 18:11:55 2003
+++ snap-cap/server/srv_main.c Wed Mar 12 00:35:31 2003
@@ -158,6 +158,7 @@
init_nls();
/* init server arguments... */
+ init_our_capability();
srvarg.metaserver_no_send = DEFAULT_META_SERVER_NO_SEND;
sz_strlcpy(srvarg.metaserver_info_line, default_meta_server_info_string());
- [Freeciv-Dev] (PR#3706) append the capstring, Mike Kaufman, 2003/03/12
- [Freeciv-Dev] Re: (PR#3706) append the capstring,
Mike Kaufman <=
- Message not available
- Message not available
- [Freeciv-Dev] Re: (PR#3706) append the capstring, Jason Short, 2003/03/12
- [Freeciv-Dev] Re: (PR#3706) append the capstring, Mike Kaufman, 2003/03/12
- [Freeciv-Dev] Re: (PR#3706) append the capstring, Jason Short, 2003/03/12
- [Freeciv-Dev] Re: (PR#3706) append the capstring, Mike Kaufman, 2003/03/13
- [Freeciv-Dev] Re: (PR#3706) append the capstring, Jason Short, 2003/03/21
- [Freeciv-Dev] Re: (PR#3706) append the capstring, Mike Kaufman, 2003/03/21
- [Freeciv-Dev] Re: (PR#3706) append the capstring, Jason Short, 2003/03/21
|
|