Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
beac78bb
Kaydet (Commit)
beac78bb
authored
Eki 11, 2011
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use PyUnicode_AsUnicodeAndSize() instead of PyUnicode_GET_SIZE()
üst
e459a087
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
9 deletions
+15
-9
posixmodule.c
Modules/posixmodule.c
+1
-2
getargs.c
Python/getargs.c
+6
-4
import.c
Python/import.c
+8
-3
No files found.
Modules/posixmodule.c
Dosyayı görüntüle @
beac78bb
...
...
@@ -2529,10 +2529,9 @@ posix_listdir(PyObject *self, PyObject *args)
po_wchars
=
L"."
;
len
=
1
;
}
else
{
po_wchars
=
PyUnicode_AsUnicode
(
po
);
po_wchars
=
PyUnicode_AsUnicode
AndSize
(
po
,
&
len
);
if
(
po_wchars
==
NULL
)
return
NULL
;
len
=
PyUnicode_GET_SIZE
(
po
);
}
/* Overallocate for \\*.*\0 */
wnamebuf
=
malloc
((
len
+
5
)
*
sizeof
(
wchar_t
));
...
...
Python/getargs.c
Dosyayı görüntüle @
beac78bb
...
...
@@ -982,10 +982,11 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
STORE_SIZE
(
0
);
}
else
if
(
PyUnicode_Check
(
arg
))
{
*
p
=
PyUnicode_AS_UNICODE
(
arg
);
Py_ssize_t
len
;
*
p
=
PyUnicode_AsUnicodeAndSize
(
arg
,
&
len
);
if
(
*
p
==
NULL
)
RETURN_ERR_OCCURRED
;
STORE_SIZE
(
PyUnicode_GET_SIZE
(
arg
)
);
STORE_SIZE
(
len
);
}
else
return
converterr
(
"str or None"
,
arg
,
msgbuf
,
bufsize
);
...
...
@@ -995,10 +996,11 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
if
(
c
==
'Z'
&&
arg
==
Py_None
)
*
p
=
NULL
;
else
if
(
PyUnicode_Check
(
arg
))
{
*
p
=
PyUnicode_AS_UNICODE
(
arg
);
Py_ssize_t
len
;
*
p
=
PyUnicode_AsUnicodeAndSize
(
arg
,
&
len
);
if
(
*
p
==
NULL
)
RETURN_ERR_OCCURRED
;
if
(
Py_UNICODE_strlen
(
*
p
)
!=
PyUnicode_GET_SIZE
(
arg
)
)
if
(
Py_UNICODE_strlen
(
*
p
)
!=
len
)
return
converterr
(
"str without null character or None"
,
arg
,
msgbuf
,
bufsize
);
...
...
Python/import.c
Dosyayı görüntüle @
beac78bb
...
...
@@ -2282,6 +2282,8 @@ case_ok(PyObject *filename, Py_ssize_t prefix_delta, PyObject *name)
WIN32_FIND_DATAW
data
;
HANDLE
h
;
int
cmp
;
wchar_t
*
wname
;
Py_ssizet
wname_len
;
if
(
Py_GETENV
(
"PYTHONCASEOK"
)
!=
NULL
)
return
1
;
...
...
@@ -2294,9 +2296,12 @@ case_ok(PyObject *filename, Py_ssize_t prefix_delta, PyObject *name)
return
0
;
}
FindClose
(
h
);
cmp
=
wcsncmp
(
data
.
cFileName
,
PyUnicode_AS_UNICODE
(
name
),
PyUnicode_GET_SIZE
(
name
));
wname
=
PyUnicode_AsUnicodeAndSize
(
name
,
&
wname_len
);
if
(
wname
==
NULL
)
return
-
1
;
cmp
=
wcsncmp
(
data
.
cFileName
,
wname
,
wname_len
);
return
cmp
==
0
;
#elif defined(USE_CASE_OK_BYTES)
int
match
;
...
...
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