startup.c 14.5 KB
Newer Older
P
Peter Eisentraut 已提交
1 2 3
/*
 * psql - the PostgreSQL interactive terminal
 *
4
 * Copyright (c) 2000-2003, PostgreSQL Global Development Group
P
Peter Eisentraut 已提交
5
 *
6
 * $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.91 2004/04/22 14:34:38 momjian Exp $
P
Peter Eisentraut 已提交
7
 */
8
#include "postgres_fe.h"
9 10 11

#include <sys/types.h>

12 13
#ifndef WIN32
#include <unistd.h>
B
Bruce Momjian 已提交
14
#else							/* WIN32 */
15
#include <io.h>
B
Hi!  
Bruce Momjian 已提交
16
#include <windows.h>
17
#include <win32.h>
18
#endif   /* WIN32 */
19

20
#include "getopt_long.h"
21 22

#ifndef HAVE_OPTRESET
B
Bruce Momjian 已提交
23
int			optreset;
24 25
#endif

P
Peter Eisentraut 已提交
26 27
#include <locale.h>

28
#include "libpq-fe.h"
29 30 31

#include "command.h"
#include "common.h"
32 33
#include "describe.h"
#include "help.h"
34
#include "input.h"
35
#include "mainloop.h"
36
#include "print.h"
37 38
#include "settings.h"
#include "variables.h"
39

40 41
#include "mb/pg_wchar.h"

42 43 44
/*
 * Global psql options
 */
45
PsqlSettings pset;
46

47
#define SYSPSQLRC	"psqlrc"
48
#define PSQLRC 		".psqlrc"
49

50 51
/*
 * Structures to pass information between the option parsing routine
52 53
 * and the main function
 */
B
Bruce Momjian 已提交
54 55
enum _actions
{
56 57 58 59 60
	ACT_NOTHING = 0,
	ACT_SINGLE_SLASH,
	ACT_LIST_DB,
	ACT_SINGLE_QUERY,
	ACT_FILE
61 62
};

B
Bruce Momjian 已提交
63 64 65 66 67 68 69 70 71
struct adhoc_opts
{
	char	   *dbname;
	char	   *host;
	char	   *port;
	char	   *username;
	enum _actions action;
	char	   *action_string;
	bool		no_readline;
72
	bool		no_psqlrc;
73 74
};

75
static void parse_psql_options(int argc, char *argv[],
B
Bruce Momjian 已提交
76
				   struct adhoc_opts * options);
77
static void process_psqlrc(void);
78
static void process_psqlrc_file(char *filename);
79
static void showVersion(void);
80

B
Bruce Momjian 已提交
81
#ifdef USE_SSL
82
static void printSSLInfo(void);
B
Bruce Momjian 已提交
83
#endif
84

B
> >  
Bruce Momjian 已提交
85 86 87 88
#ifdef WIN32
static void
			checkWin32Codepage(void);
#endif
89 90 91

/*
 *
92
 * main
93 94 95
 *
 */
int
96
main(int argc, char *argv[])
97
{
B
Bruce Momjian 已提交
98 99
	struct adhoc_opts options;
	int			successResult;
100

B
Bruce Momjian 已提交
101 102 103
	char	   *username = NULL;
	char	   *password = NULL;
	bool		need_pass;
104

P
Peter Eisentraut 已提交
105
	setlocale(LC_ALL, "");
106
#ifdef ENABLE_NLS
P
Peter Eisentraut 已提交
107 108 109 110
	bindtextdomain("psql", LOCALEDIR);
	textdomain("psql");
#endif

111
	pset.progname = get_progname(argv[0]);
112

113 114
	if (argc > 1)
	{
B
Bruce Momjian 已提交
115
		if (strcmp(argv[1], "--help") == 0 || strcmp(argv[1], "-?") == 0)
116 117 118 119
		{
			usage();
			exit(EXIT_SUCCESS);
		}
B
Bruce Momjian 已提交
120
		if (strcmp(argv[1], "--version") == 0 || strcmp(argv[1], "-V") == 0)
121 122 123 124
		{
			showVersion();
			exit(EXIT_SUCCESS);
		}
B
Bruce Momjian 已提交
125
	}
126

127 128
	pset.cur_cmd_source = stdin;
	pset.cur_cmd_interactive = false;
129
	pset.encoding = PQenv2encoding();
130

131
	pset.vars = CreateVariableSpace();
132 133
	if (!pset.vars)
	{
P
Peter Eisentraut 已提交
134
		fprintf(stderr, gettext("%s: out of memory\n"), pset.progname);
135 136
		exit(EXIT_FAILURE);
	}
137 138 139
	pset.popt.topt.format = PRINT_ALIGNED;
	pset.queryFout = stdout;
	pset.popt.topt.border = 1;
140
	pset.popt.topt.pager = 1;
141
	pset.popt.default_footer = true;
142

143
	SetVariable(pset.vars, "VERSION", PG_VERSION_STR);
144

145 146
	/* Default values for variables that are used in noninteractive cases */
	SetVariableBool(pset.vars, "AUTOCOMMIT");
147
	SetVariable(pset.vars, "VERBOSITY", "default");
148
	pset.verbosity = PQERRORS_DEFAULT;
149

150
	pset.notty = (!isatty(fileno(stdin)) || !isatty(fileno(stdout)));
151

152
	/* This is obsolete and should be removed sometime. */
153
#ifdef PSQL_ALWAYS_GET_PASSWORDS
154
	pset.getPassword = true;
155
#else
156
	pset.getPassword = false;
157 158
#endif

159 160 161 162 163
#ifndef HAVE_UNIX_SOCKETS
	/* default to localhost on platforms without unix sockets */
	options.host = "localhost";
#endif

164
	parse_psql_options(argc, argv, &options);
165

166
	if (!pset.popt.topt.fieldSep)
167
		pset.popt.topt.fieldSep = pg_strdup(DEFAULT_FIELD_SEP);
168
	if (!pset.popt.topt.recordSep)
169
		pset.popt.topt.recordSep = pg_strdup(DEFAULT_RECORD_SEP);
170

B
Bruce Momjian 已提交
171 172
	if (options.username)
	{
173 174 175 176 177
		/*
		 * The \001 is a hack to support the deprecated -u option which
		 * issues a username prompt. The recommended option is -U followed
		 * by the name on the command line.
		 */
178
		if (strcmp(options.username, "\001") == 0)
179
			username = simple_prompt("User name: ", 100, true);
B
Bruce Momjian 已提交
180
		else
181
			username = pg_strdup(options.username);
182 183
	}

184
	if (pset.getPassword)
B
Bruce Momjian 已提交
185
		password = simple_prompt("Password: ", 100, false);
186

B
Bruce Momjian 已提交
187 188 189 190
	/* loop until we have a password if requested by backend */
	do
	{
		need_pass = false;
191
		pset.db = PQsetdbLogin(options.host, options.port, NULL, NULL,
192 193
			options.action == ACT_LIST_DB ? "template1" : options.dbname,
							   username, password);
B
Bruce Momjian 已提交
194

195
		if (PQstatus(pset.db) == CONNECTION_BAD &&
196 197
			strcmp(PQerrorMessage(pset.db), "fe_sendauth: no password supplied\n") == 0 &&
			!feof(stdin))
B
Bruce Momjian 已提交
198
		{
199
			PQfinish(pset.db);
B
Bruce Momjian 已提交
200 201 202 203 204 205
			need_pass = true;
			free(password);
			password = NULL;
			password = simple_prompt("Password: ", 100, false);
		}
	} while (need_pass);
206

B
Bruce Momjian 已提交
207 208 209
	free(username);
	free(password);

210
	if (PQstatus(pset.db) == CONNECTION_BAD)
B
Bruce Momjian 已提交
211
	{
212
		fprintf(stderr, "%s: %s", pset.progname, PQerrorMessage(pset.db));
213
		PQfinish(pset.db);
B
Bruce Momjian 已提交
214 215 216
		exit(EXIT_BADCONN);
	}

217 218
	PQsetNoticeProcessor(pset.db, NoticeProcessor, NULL);

219
	SyncVariables();
P
Peter Eisentraut 已提交
220

B
Bruce Momjian 已提交
221 222
	if (options.action == ACT_LIST_DB)
	{
223
		int			success = listAllDbs(false);
B
Bruce Momjian 已提交
224

225
		PQfinish(pset.db);
226
		exit(success ? EXIT_SUCCESS : EXIT_FAILURE);
B
Bruce Momjian 已提交
227 228
	}

229
	/*
230 231
	 * Now find something to do
	 */
B
Bruce Momjian 已提交
232

233
	/*
234 235
	 * process file given by -f
	 */
236
	if (options.action == ACT_FILE && strcmp(options.action_string, "-") != 0)
237 238 239
	{
		if (!options.no_psqlrc)
			process_psqlrc();
240

241
		successResult = process_file(options.action_string);
242 243
	}

244
	/*
245 246
	 * process slash command if one was given to -c
	 */
B
Bruce Momjian 已提交
247
	else if (options.action == ACT_SINGLE_SLASH)
248
	{
249 250
		PsqlScanState scan_state;

251
		if (VariableEquals(pset.vars, "ECHO", "all"))
252
			puts(options.action_string);
253

254 255 256 257 258 259
		scan_state = psql_scan_create();
		psql_scan_setup(scan_state,
						options.action_string,
						strlen(options.action_string));

		successResult = HandleSlashCmds(scan_state, NULL) != CMD_ERROR
260
			? EXIT_SUCCESS : EXIT_FAILURE;
261 262

		psql_scan_destroy(scan_state);
263 264
	}

265
	/*
266 267
	 * If the query given to -c was a normal one, send it
	 */
B
Bruce Momjian 已提交
268
	else if (options.action == ACT_SINGLE_QUERY)
269
	{
270
		if (VariableEquals(pset.vars, "ECHO", "all"))
271
			puts(options.action_string);
272

273
		successResult = SendQuery(options.action_string)
274 275 276
			? EXIT_SUCCESS : EXIT_FAILURE;
	}

277
	/*
278 279
	 * or otherwise enter interactive main loop
	 */
B
Bruce Momjian 已提交
280
	else
281 282 283
	{
		if (!QUIET() && !pset.notty)
		{
284
			printf(gettext("Welcome to %s %s, the PostgreSQL interactive terminal.\n\n"
P
Peter Eisentraut 已提交
285 286
						   "Type:  \\copyright for distribution terms\n"
						   "       \\h for help with SQL commands\n"
287 288
						   "       \\? for help with psql commands\n"
						   "       \\g or terminate with semicolon to execute query\n"
P
Peter Eisentraut 已提交
289
						   "       \\q to quit\n\n"),
290
				   pset.progname, PG_VERSION);
B
Bruce Momjian 已提交
291
#ifdef USE_SSL
292
			printSSLInfo();
B
> >  
Bruce Momjian 已提交
293 294 295
#endif
#ifdef WIN32
			checkWin32Codepage();
B
Bruce Momjian 已提交
296
#endif
297 298
		}

299
		/* Default values for variables that are used in interactive case */
300 301 302
		SetVariable(pset.vars, "PROMPT1", DEFAULT_PROMPT1);
		SetVariable(pset.vars, "PROMPT2", DEFAULT_PROMPT2);
		SetVariable(pset.vars, "PROMPT3", DEFAULT_PROMPT3);
303

304 305 306 307
		if (!options.no_psqlrc)
			process_psqlrc();
		if (!pset.notty)
			initializeInput(options.no_readline ? 0 : 1);
308
		if (options.action_string)		/* -f - was used */
309
			pset.inputfile = "<stdin>";
310

P
Peter Eisentraut 已提交
311
		successResult = MainLoop(stdin);
312
	}
B
Bruce Momjian 已提交
313 314

	/* clean up */
315 316
	PQfinish(pset.db);
	setQFout(NULL);
B
Bruce Momjian 已提交
317 318

	return successResult;
319 320 321 322 323 324 325 326 327
}



/*
 * Parse command line options
 */

static void
328
parse_psql_options(int argc, char *argv[], struct adhoc_opts * options)
329
{
330
	static struct option long_options[] =
331 332
	{
		{"echo-all", no_argument, NULL, 'a'},
B
Bruce Momjian 已提交
333 334 335
		{"no-align", no_argument, NULL, 'A'},
		{"command", required_argument, NULL, 'c'},
		{"dbname", required_argument, NULL, 'd'},
336
		{"echo-queries", no_argument, NULL, 'e'},
337
		{"echo-hidden", no_argument, NULL, 'E'},
B
Bruce Momjian 已提交
338
		{"file", required_argument, NULL, 'f'},
339
		{"field-separator", required_argument, NULL, 'F'},
B
Bruce Momjian 已提交
340 341 342
		{"host", required_argument, NULL, 'h'},
		{"html", no_argument, NULL, 'H'},
		{"list", no_argument, NULL, 'l'},
343
		{"no-readline", no_argument, NULL, 'n'},
344
		{"output", required_argument, NULL, 'o'},
B
Bruce Momjian 已提交
345 346 347
		{"port", required_argument, NULL, 'p'},
		{"pset", required_argument, NULL, 'P'},
		{"quiet", no_argument, NULL, 'q'},
348
		{"record-separator", required_argument, NULL, 'R'},
B
Bruce Momjian 已提交
349 350 351 352 353 354 355 356 357
		{"single-step", no_argument, NULL, 's'},
		{"single-line", no_argument, NULL, 'S'},
		{"tuples-only", no_argument, NULL, 't'},
		{"table-attr", required_argument, NULL, 'T'},
		{"username", required_argument, NULL, 'U'},
		{"set", required_argument, NULL, 'v'},
		{"variable", required_argument, NULL, 'v'},
		{"version", no_argument, NULL, 'V'},
		{"password", no_argument, NULL, 'W'},
358
		{"expanded", no_argument, NULL, 'x'},
359
		{"no-psqlrc", no_argument, NULL, 'X'},
B
Bruce Momjian 已提交
360
		{"help", no_argument, NULL, '?'},
T
Tatsuo Ishii 已提交
361
		{NULL, 0, NULL, 0}
B
Bruce Momjian 已提交
362 363 364 365 366 367
	};

	int			optindex;
	extern char *optarg;
	extern int	optind;
	int			c;
368
	bool		used_old_u_option = false;
369

370
	memset(options, 0, sizeof *options);
371

372 373
	while ((c = getopt_long(argc, argv, "aAc:d:eEf:F:h:Hlno:p:P:qR:sStT:uU:v:VWxX?",
							long_options, &optindex)) != -1)
374
	{
B
Bruce Momjian 已提交
375 376
		switch (c)
		{
377 378 379
			case 'a':
				SetVariable(pset.vars, "ECHO", "all");
				break;
B
Bruce Momjian 已提交
380
			case 'A':
381
				pset.popt.topt.format = PRINT_UNALIGNED;
B
Bruce Momjian 已提交
382 383 384 385
				break;
			case 'c':
				options->action_string = optarg;
				if (optarg[0] == '\\')
P
Peter Eisentraut 已提交
386
				{
B
Bruce Momjian 已提交
387
					options->action = ACT_SINGLE_SLASH;
P
Peter Eisentraut 已提交
388 389
					options->action_string++;
				}
B
Bruce Momjian 已提交
390 391 392 393 394 395 396
				else
					options->action = ACT_SINGLE_QUERY;
				break;
			case 'd':
				options->dbname = optarg;
				break;
			case 'e':
397
				SetVariable(pset.vars, "ECHO", "queries");
B
Bruce Momjian 已提交
398 399
				break;
			case 'E':
400
				SetVariableBool(pset.vars, "ECHO_HIDDEN");
B
Bruce Momjian 已提交
401 402 403 404 405 406
				break;
			case 'f':
				options->action = ACT_FILE;
				options->action_string = optarg;
				break;
			case 'F':
407
				pset.popt.topt.fieldSep = pg_strdup(optarg);
B
Bruce Momjian 已提交
408 409 410 411 412
				break;
			case 'h':
				options->host = optarg;
				break;
			case 'H':
413
				pset.popt.topt.format = PRINT_HTML;
B
Bruce Momjian 已提交
414 415 416 417 418 419 420 421
				break;
			case 'l':
				options->action = ACT_LIST_DB;
				break;
			case 'n':
				options->no_readline = true;
				break;
			case 'o':
422
				setQFout(optarg);
B
Bruce Momjian 已提交
423 424 425 426 427 428 429 430 431 432
				break;
			case 'p':
				options->port = optarg;
				break;
			case 'P':
				{
					char	   *value;
					char	   *equal_loc;
					bool		result;

433
					value = pg_strdup(optarg);
B
Bruce Momjian 已提交
434 435
					equal_loc = strchr(value, '=');
					if (!equal_loc)
436
						result = do_pset(value, NULL, &pset.popt, true);
B
Bruce Momjian 已提交
437 438 439
					else
					{
						*equal_loc = '\0';
440
						result = do_pset(value, equal_loc + 1, &pset.popt, true);
B
Bruce Momjian 已提交
441 442 443 444
					}

					if (!result)
					{
445
						fprintf(stderr, gettext("%s: couldn't set printing parameter \"%s\"\n"), pset.progname, value);
B
Bruce Momjian 已提交
446 447 448 449 450 451 452
						exit(EXIT_FAILURE);
					}

					free(value);
					break;
				}
			case 'q':
453
				SetVariableBool(pset.vars, "QUIET");
B
Bruce Momjian 已提交
454
				break;
455
			case 'R':
456
				pset.popt.topt.recordSep = pg_strdup(optarg);
457
				break;
B
Bruce Momjian 已提交
458
			case 's':
459
				SetVariableBool(pset.vars, "SINGLESTEP");
B
Bruce Momjian 已提交
460 461
				break;
			case 'S':
462
				SetVariableBool(pset.vars, "SINGLELINE");
B
Bruce Momjian 已提交
463 464
				break;
			case 't':
465
				pset.popt.topt.tuples_only = true;
B
Bruce Momjian 已提交
466 467
				break;
			case 'T':
468
				pset.popt.topt.tableAttr = pg_strdup(optarg);
B
Bruce Momjian 已提交
469 470
				break;
			case 'u':
471
				pset.getPassword = true;
472 473 474 475
				options->username = "\001";		/* hopefully nobody has
												 * that username */
				/* this option is out */
				used_old_u_option = true;
B
Bruce Momjian 已提交
476 477 478 479 480 481 482 483 484
				break;
			case 'U':
				options->username = optarg;
				break;
			case 'v':
				{
					char	   *value;
					char	   *equal_loc;

485
					value = pg_strdup(optarg);
B
Bruce Momjian 已提交
486 487 488
					equal_loc = strchr(value, '=');
					if (!equal_loc)
					{
489
						if (!DeleteVariable(pset.vars, value))
B
Bruce Momjian 已提交
490
						{
491
							fprintf(stderr, gettext("%s: could not delete variable \"%s\"\n"),
492
									pset.progname, value);
B
Bruce Momjian 已提交
493 494 495 496 497 498
							exit(EXIT_FAILURE);
						}
					}
					else
					{
						*equal_loc = '\0';
499
						if (!SetVariable(pset.vars, value, equal_loc + 1))
B
Bruce Momjian 已提交
500
						{
501
							fprintf(stderr, gettext("%s: could not set variable \"%s\"\n"),
502
									pset.progname, value);
B
Bruce Momjian 已提交
503 504 505 506 507 508 509 510
							exit(EXIT_FAILURE);
						}
					}

					free(value);
					break;
				}
			case 'V':
511 512
				showVersion();
				exit(EXIT_SUCCESS);
B
Bruce Momjian 已提交
513
			case 'W':
514
				pset.getPassword = true;
B
Bruce Momjian 已提交
515
				break;
516 517 518
			case 'x':
				pset.popt.topt.expanded = true;
				break;
519 520 521
			case 'X':
				options->no_psqlrc = true;
				break;
B
Bruce Momjian 已提交
522
			case '?':
523 524 525 526 527 528 529 530 531
				/* Actual help option given */
				if (strcmp(argv[optind - 1], "-?") == 0 || strcmp(argv[optind - 1], "--help") == 0)
				{
					usage();
					exit(EXIT_SUCCESS);
				}
				/* unknown option reported by getopt */
				else
				{
532
					fprintf(stderr, gettext("Try \"%s --help\" for more information.\n"),
533
							pset.progname);
534
					exit(EXIT_FAILURE);
535
				}
B
Bruce Momjian 已提交
536 537
				break;
			default:
538
				fprintf(stderr, gettext("Try \"%s --help\" for more information.\n"),
539
						pset.progname);
540
				exit(EXIT_FAILURE);
B
Bruce Momjian 已提交
541 542
				break;
		}
543 544
	}

B
Bruce Momjian 已提交
545 546 547 548 549 550 551 552 553 554
	/*
	 * if we still have arguments, use it as the database name and
	 * username
	 */
	while (argc - optind >= 1)
	{
		if (!options->dbname)
			options->dbname = argv[optind];
		else if (!options->username)
			options->username = argv[optind];
555
		else if (!QUIET())
556
			fprintf(stderr, gettext("%s: warning: extra command-line argument \"%s\" ignored\n"),
557
					pset.progname, argv[optind]);
B
Bruce Momjian 已提交
558 559 560

		optind++;
	}
561

562
	if (used_old_u_option && !QUIET())
P
Peter Eisentraut 已提交
563
		fprintf(stderr, gettext("%s: Warning: The -u option is deprecated. Use -U.\n"), pset.progname);
564

565 566
}

567 568 569
#ifndef SYSCONFDIR
#error "You must compile this file with SYSCONFDIR defined."
#endif
570 571 572


/*
P
Peter Eisentraut 已提交
573
 * Load .psqlrc file, if found.
574 575
 */
static void
576
process_psqlrc(void)
577
{
578
	char	   *globalFile = SYSCONFDIR "/" SYSPSQLRC;
B
Bruce Momjian 已提交
579
	char	   *home;
580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597
	char	   *psqlrc;

	process_psqlrc_file(globalFile);

	if ((home = getenv("HOME")) != NULL)
	{
		psqlrc = pg_malloc(strlen(home) + 1 + strlen(PSQLRC) + 1);
		sprintf(psqlrc, "%s/%s", home, PSQLRC);
		process_psqlrc_file(psqlrc);
	}
}



static void
process_psqlrc_file(char *filename)
{
	char	   *psqlrc;
598

599 600
#if defined(WIN32) && (!defined(__MINGW32__))
#define R_OK 4
601 602
#endif

603 604
	psqlrc = pg_malloc(strlen(filename) + 1 + strlen(PG_VERSION) + 1);
	sprintf(psqlrc, "%s-%s", filename, PG_VERSION);
605

606 607 608 609 610
	if (access(psqlrc, R_OK) == 0)
		process_file(psqlrc);
	else if (access(filename, R_OK) == 0)
			process_file(filename);
	free(psqlrc);
611 612 613 614 615 616
}



/* showVersion
 *
617
 * This output format is intended to match GNU standards.
618 619
 */
static void
620
showVersion(void)
621
{
622
	puts("psql (PostgreSQL) " PG_VERSION);
623

624
#if defined(USE_READLINE)
625
	puts(gettext("contains support for command-line editing"));
626
#endif
627
}
B
Bruce Momjian 已提交
628 629 630 631 632 633 634 635 636



/*
 * printSSLInfo
 *
 * Prints information about the current SSL connection, if SSL is in use
 */
#ifdef USE_SSL
B
Bruce Momjian 已提交
637
static void
B
Bruce Momjian 已提交
638 639
printSSLInfo(void)
{
B
Bruce Momjian 已提交
640 641
	int			sslbits = -1;
	SSL		   *ssl;
B
Bruce Momjian 已提交
642 643 644

	ssl = PQgetssl(pset.db);
	if (!ssl)
B
Bruce Momjian 已提交
645
		return;					/* no SSL */
B
Bruce Momjian 已提交
646 647

	SSL_get_cipher_bits(ssl, &sslbits);
648
	printf(gettext("SSL connection (cipher: %s, bits: %i)\n\n"),
B
Bruce Momjian 已提交
649
		   SSL_get_cipher(ssl), sslbits);
B
Bruce Momjian 已提交
650
}
651

B
Bruce Momjian 已提交
652
#endif
B
> >  
Bruce Momjian 已提交
653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676



/*
 * checkWin32Codepage
 *
 * Prints a warning when win32 console codepage differs from Windows codepage
 */
#ifdef WIN32
static void
checkWin32Codepage(void)
{
	unsigned int wincp, concp;

	wincp = GetACP();
	concp = GetConsoleCP();
	if (wincp != concp) {
	  printf("Warning: Console codepage (%u) differs from windows codepage (%u)\n"
			 "         8-bit characters will not work correctly. See PostgreSQL\n"
			 "         documentation \"Installation on Windows\" for details.\n\n",
			 concp, wincp);
	}
}
#endif