comparison Python/getopt.c @ 75143:88aede44ded1

Fix test failure in test_cmd_line by initializing the hash secret at the earliest point.
author Antoine Pitrou <solipsis@pitrou.net>
date Tue, 21 Feb 2012 19:08:26 +0100
parents 0e8bd4785ea0
children 0153c077a0fd
comparison
equal deleted inserted replaced
75141:2fed68cf102a 75143:88aede44ded1
39 39
40 int _PyOS_opterr = 1; /* generate error messages */ 40 int _PyOS_opterr = 1; /* generate error messages */
41 int _PyOS_optind = 1; /* index into argv array */ 41 int _PyOS_optind = 1; /* index into argv array */
42 wchar_t *_PyOS_optarg = NULL; /* optional argument */ 42 wchar_t *_PyOS_optarg = NULL; /* optional argument */
43 43
44 static wchar_t *opt_ptr = L"";
45
46 void _PyOS_ResetGetOpt(void)
47 {
48 _PyOS_opterr = 1;
49 _PyOS_optind = 1;
50 _PyOS_optarg = NULL;
51 opt_ptr = L"";
52 }
53
44 int _PyOS_GetOpt(int argc, wchar_t **argv, wchar_t *optstring) 54 int _PyOS_GetOpt(int argc, wchar_t **argv, wchar_t *optstring)
45 { 55 {
46 static wchar_t *opt_ptr = L"";
47 wchar_t *ptr; 56 wchar_t *ptr;
48 wchar_t option; 57 wchar_t option;
49 58
50 if (*opt_ptr == '\0') { 59 if (*opt_ptr == '\0') {
51 60