summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2008-04-05 20:41:37 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2008-04-05 20:41:37 (GMT)
commit790465fd90e8a72590386465f518db9e67ab843f (patch)
tree62e3e47f6f97120dfdfc94a87dc1a06414d95a13 /Objects
parentb9279bc88f867d9d3b6606502a678b137329b54d (diff)
downloadcpython-790465fd90e8a72590386465f518db9e67ab843f.zip
cpython-790465fd90e8a72590386465f518db9e67ab843f.tar.gz
cpython-790465fd90e8a72590386465f518db9e67ab843f.tar.bz2
Change command line processing API to use wchar_t.
Fixes #2128.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/unicodeobject.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 60cbffa..29ca08c 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -553,10 +553,16 @@ PyObject *PyUnicode_FromWideChar(register const wchar_t *w,
PyUnicodeObject *unicode;
if (w == NULL) {
+ if (size == 0)
+ return PyUnicode_FromStringAndSize(NULL, 0);
PyErr_BadInternalCall();
return NULL;
}
+ if (size == -1) {
+ size = wcslen(w);
+ }
+
unicode = _PyUnicode_New(size);
if (!unicode)
return NULL;