Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
91e3e8b7
Commit
91e3e8b7
authored
Nov 13, 2003
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch #804543: strdup saved locales. Backported to 2.3.
parent
7f422480
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
Modules/readline.c
Modules/readline.c
+2
-1
Python/pythonrun.c
Python/pythonrun.c
+2
-1
No files found.
Modules/readline.c
View file @
91e3e8b7
...
...
@@ -611,7 +611,7 @@ static void
setup_readline
(
void
)
{
#ifdef SAVE_LOCALE
char
*
saved_locale
=
s
etlocale
(
LC_CTYPE
,
NULL
);
char
*
saved_locale
=
s
trdup
(
setlocale
(
LC_CTYPE
,
NULL
)
);
#endif
using_history
();
...
...
@@ -652,6 +652,7 @@ setup_readline(void)
#ifdef SAVE_LOCALE
setlocale
(
LC_CTYPE
,
saved_locale
);
/* Restore locale */
free
(
saved_locale
);
#endif
}
...
...
Python/pythonrun.c
View file @
91e3e8b7
...
...
@@ -235,7 +235,7 @@ Py_Initialize(void)
initialized by other means. Also set the encoding of
stdin and stdout if these are terminals. */
saved_locale
=
s
etlocale
(
LC_CTYPE
,
NULL
);
saved_locale
=
s
trdup
(
setlocale
(
LC_CTYPE
,
NULL
)
);
setlocale
(
LC_CTYPE
,
""
);
codeset
=
nl_langinfo
(
CODESET
);
if
(
codeset
&&
*
codeset
)
{
...
...
@@ -250,6 +250,7 @@ Py_Initialize(void)
}
else
codeset
=
NULL
;
setlocale
(
LC_CTYPE
,
saved_locale
);
free
(
saved_locale
);
if
(
codeset
)
{
sys_stream
=
PySys_GetObject
(
"stdin"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment