Complete.Org:
Mailing Lists:
Archives:
freeciv-dev:
September 2005: [Freeciv-Dev] (PR#13839) [Fwd: Bringing civmanual up-to-date] |
![]() |
[Freeciv-Dev] (PR#13839) [Fwd: Bringing civmanual up-to-date][Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13839 > -------- Original Message -------- From: - Tue Aug 30 03:08:59 2005 X-Account-Key: account1 X-UIDL: GmailId10605fa736f16c01 X-Mozilla-Status: 0001 X-Mozilla-Status2: 10000000 X-Gmail-Received: d291d089f925247ed3c89069a579e233e0384b1e Delivered-To: jdorje@xxxxxxxxx Received: by 10.70.56.8 with SMTP id e8cs6841wxa; Mon, 29 Aug 2005 23:02:11 -0700 (PDT) Received: by 10.38.98.53 with SMTP id v53mr154206rnb; Mon, 29 Aug 2005 23:02:11 -0700 (PDT) Return-Path: <freeciv-dev-bounce@xxxxxxxxxxx> Received: from freeciv.freeciv.org (www.freeciv.org [207.158.49.130]) by mx.gmail.com with ESMTP id m35si1523303rnd.2005.08.29.23.02.10; Mon, 29 Aug 2005 23:02:11 -0700 (PDT) Received-SPF: pass (gmail.com: best guess record for domain of freeciv-dev-bounce@xxxxxxxxxxx designates 207.158.49.130 as permitted sender) Received: from glockenspiel.complete.org (glockenspiel.complete.org [69.10.152.57]) by freeciv.freeciv.org (8.12.10/8.12.10) with ESMTP id j7U625xB004907; Mon, 29 Aug 2005 23:02:05 -0700 Received: from localhost ([127.0.0.1] helo=glockenspiel) by glockenspiel.complete.org with esmtp (Exim 4.50) id 1E9zBL-0003tr-0S; Tue, 30 Aug 2005 01:01:19 -0500 Received: with ECARTIS (v1.0.0; list freeciv-dev); Tue, 30 Aug 2005 01:01:04 -0500 (CDT) Received: from par69-4-82-227-117-3.fbx.proxad.net ([82.227.117.3] helo=saline) by glockenspiel.complete.org with esmtps (with TLS-1.0:RSA_AES_256_CBC_SHA:32) (No TLS peer certificate) (Exim 4.50) id 1E9zAf-0003ss-L4 for freeciv-dev@xxxxxxxxxxx; Tue, 30 Aug 2005 01:01:03 -0500 Received: from gmelquio by saline with local (Exim 4.52) id 1E9zAS-0001SY-4F for freeciv-dev@xxxxxxxxxxx; Tue, 30 Aug 2005 08:00:20 +0200 Subject: [Freeciv-Dev] Bringing civmanual up-to-date From: Guillaume Melquiond <guillaume.melquiond@xxxxxxxxxxx> To: freeciv-dev@xxxxxxxxxxx Content-Type: multipart/mixed; boundary="=-kXJQRmPqKMZP2YJUGHGm" Date: Tue, 30 Aug 2005 08:00:19 +0200 Message-Id: <1125381619.4765.16.camel@saline> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 X-Spam-Status: No (score 0.8): AWL=0.785 X-Virus-Scanned: by Exiscan on glockenspiel.complete.org at Tue, 30 Aug 2005 01:01:03 -0500 X-archive-position: 1720 X-ecartis-version: Ecartis v1.0.0 Sender: freeciv-dev-bounce@xxxxxxxxxxx Errors-to: freeciv-dev-bounce@xxxxxxxxxxx X-original-sender: guillaume.melquiond@xxxxxxxxxxx Precedence: bulk List-help: <mailto:ecartis@xxxxxxxxxxx?Subject=help> List-unsubscribe: <mailto:freeciv-dev-request@xxxxxxxxxxx?Subject=unsubscribe> List-software: Ecartis version 1.0.0 List-Id: <freeciv-dev.freeciv.org> X-List-ID: <freeciv-dev.freeciv.org> List-subscribe: <mailto:freeciv-dev-request@xxxxxxxxxxx?Subject=subscribe> List-owner: <mailto:freeciv-dev-admins@xxxxxxxxxxx> List-post: <mailto:freeciv-dev@xxxxxxxxxxx> X-list: freeciv-dev X-Spam-Status: No (score 0.4): AWL=0.393 X-Virus-Scanned: by Exiscan on glockenspiel.complete.org at Tue, 30 Aug 2005 01:01:19 -0500 Hi, As explained in http://forum.freeciv.org/viewtopic.php?t=1172 , here are two trivial patches to be applied on CVS HEAD, so that civmanual can at least run properly. The first one touches the core of Freeciv. It prevents get_tech_name from calling get_player_research by moving away the local variables when not needed. Otherwise civmanual fails an assertion because its team is NULL. The second one deals with civmanual itself. It does a proper setup through game_init. It also fixes the HTML generation, so that the pages are described as UTF-8 encoded, and so that the image files are correctly quoted. Regards, Guillaume Index: common/tech.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/common/tech.c,v retrieving revision 1.99 diff -u -r1.99 tech.c --- common/tech.c 20 Jul 2005 07:19:20 -0000 1.99 +++ common/tech.c 30 Aug 2005 05:44:28 -0000 @@ -588,10 +588,6 @@ **************************************************************************/ const char *get_tech_name(const struct player *pplayer, Tech_type_id tech) { - static struct string_vector future; - int i; - struct player_research *research = get_player_research(pplayer); - /* We don't return a static buffer because that would break anything that * needed to work with more than one name at a time. */ switch (tech) { @@ -602,6 +598,11 @@ /* TRANS: "None" tech */ return _("None"); case A_FUTURE: + { + static struct string_vector future; + int i; + struct player_research *research = get_player_research(pplayer); + /* pplayer->future_tech == 0 means "Future Tech. 1". */ for (i = future.size; i <= research->future_tech; i++) { char *ptr = NULL; @@ -616,6 +617,7 @@ future.p[research->future_tech] = mystrdup(buffer); } return future.p[research->future_tech]; + } default: /* Includes A_NONE */ if (!tech_exists(tech)) { Index: manual/civmanual.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/manual/civmanual.c,v retrieving revision 1.16 diff -u -r1.16 civmanual.c --- manual/civmanual.c 8 Aug 2005 16:30:24 -0000 1.16 +++ manual/civmanual.c 30 Aug 2005 05:44:57 -0000 @@ -69,10 +69,11 @@ /* This formats the manual for an HTML wiki. */ #ifdef USE_HTML #define HEADER "<html><head><link rel=\"stylesheet\" type=\"text/css\" "\ - "href=\"manual.css\" /></head><body>\n\n" + "href=\"manual.css\"/><meta http-equiv=\"Content-Type\" "\ + "content=\"text/html; charset=UTF-8\"/></head><body>\n\n" #define SECTION_BEGIN "<h3>" #define SECTION_END "</h3>" -#define IMAGE_BEGIN "<img src=" +#define IMAGE_BEGIN "<img src=\"" #define IMAGE_END ".png\">" #define SEPARATOR " " #define TAIL "</body></html>" @@ -108,6 +109,7 @@ char filename[40]; enum manuals manuals; + game_init(); load_rulesets(); for (manuals = 0; manuals < MANUAL_COUNT; manuals++) { int i;
|