~ubuntu-branches/debian/squeeze/freeciv/squeeze

« back to all changes in this revision

Viewing changes to client/connectdlg_common.c

  • Committer: Bazaar Package Importer
  • Author(s): Clint Adams
  • Date: 2010-02-08 07:36:40 UTC
  • mfrom: (1.2.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20100208073640-pzgcnz2z2tod5cu9
Tags: 2.1.11-1
* New upstream version.
* Bump to Standards-Version 3.8.4.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
#endif
39
39
 
40
40
#include "capability.h"
 
41
#include "fciconv.h"
41
42
#include "fcintl.h"
42
43
#include "log.h"
43
44
#include "mem.h"
203
204
  char cmdline3[512];
204
205
  char logcmdline[512];
205
206
  char scriptcmdline[512];
 
207
  char savescmdline[512];
206
208
# endif
207
209
 
208
210
  /* only one server (forked from this client) shall be running at a time */
302
304
  logcmdline[0] = 0;
303
305
  scriptcmdline[0] = 0;
304
306
 
 
307
  /* the server expects command line arguments to be in local encoding */
305
308
  if (logfile) {
 
309
    char *logfile_in_local_encoding = internal_to_local_string_malloc(logfile);
306
310
    my_snprintf(logcmdline, sizeof(logcmdline), " --debug 3 --log %s",
307
 
                logfile);
 
311
                logfile_in_local_encoding);
 
312
    free(logfile_in_local_encoding);
308
313
  }
309
314
  if (scriptfile) {
 
315
    char *scriptfile_in_local_encoding = internal_to_local_string_malloc(scriptfile);
310
316
    my_snprintf(scriptcmdline, sizeof(scriptcmdline),  " --read %s",
311
 
                scriptfile);
 
317
                scriptfile_in_local_encoding);
 
318
    free(scriptfile_in_local_encoding);
312
319
  }
313
320
 
314
321
  interpret_tilde(savesdir, sizeof(savesdir), "~/.freeciv/saves");
 
322
  internal_to_local_string_buffer(savesdir, savescmdline, sizeof(savescmdline));
315
323
 
316
324
  my_snprintf(options, sizeof(options), "-p %d -q 1 -e%s%s --saves \"%s\"",
317
 
              internal_server_port, logcmdline, scriptcmdline, savesdir);
 
325
              internal_server_port, logcmdline, scriptcmdline, savescmdline);
318
326
  my_snprintf(cmdline1, sizeof(cmdline1), "./ser %s", options);
319
327
  my_snprintf(cmdline2, sizeof(cmdline2), "./server/civserver %s", options);
320
328
  my_snprintf(cmdline3, sizeof(cmdline3), "civserver %s", options);
458
466
{
459
467
  /* remove challenge file */
460
468
  if (challenge_fullname[0] != '\0') {
461
 
    if (remove(challenge_fullname) == -1) {
 
469
    if (fc_remove(challenge_fullname) == -1) {
462
470
      freelog(LOG_ERROR, "Couldn't remove temporary file: %s",
463
471
              challenge_fullname);
464
472
    }