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
eda12ecc
Kaydet (Commit)
eda12ecc
authored
Agu 24, 2007
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Patch by Ero Carrera to get rid of PyString in timemodule.c.
üst
28bbe425
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
timemodule.c
Modules/timemodule.c
+10
-3
No files found.
Modules/timemodule.c
Dosyayı görüntüle @
eda12ecc
...
@@ -377,13 +377,17 @@ time_strftime(PyObject *self, PyObject *args)
...
@@ -377,13 +377,17 @@ time_strftime(PyObject *self, PyObject *args)
PyObject
*
tup
=
NULL
;
PyObject
*
tup
=
NULL
;
struct
tm
buf
;
struct
tm
buf
;
const
char
*
fmt
;
const
char
*
fmt
;
PyObject
*
format
;
size_t
fmtlen
,
buflen
;
size_t
fmtlen
,
buflen
;
char
*
outbuf
=
0
;
char
*
outbuf
=
0
;
size_t
i
;
size_t
i
;
memset
((
void
*
)
&
buf
,
'\0'
,
sizeof
(
buf
));
memset
((
void
*
)
&
buf
,
'\0'
,
sizeof
(
buf
));
if
(
!
PyArg_ParseTuple
(
args
,
"s|O:strftime"
,
&
fmt
,
&
tup
))
/* Will always expect a unicode string to be passed as format.
Given that there's no str type anymore in py3k this seems safe.
*/
if
(
!
PyArg_ParseTuple
(
args
,
"U|O:strftime"
,
&
format
,
&
tup
))
return
NULL
;
return
NULL
;
if
(
tup
==
NULL
)
{
if
(
tup
==
NULL
)
{
...
@@ -458,6 +462,9 @@ time_strftime(PyObject *self, PyObject *args)
...
@@ -458,6 +462,9 @@ time_strftime(PyObject *self, PyObject *args)
return
NULL
;
return
NULL
;
}
}
/* Convert the unicode string to an ascii one */
fmt
=
PyUnicode_AsString
(
format
);
fmtlen
=
strlen
(
fmt
);
fmtlen
=
strlen
(
fmt
);
/* I hate these functions that presume you know how big the output
/* I hate these functions that presume you know how big the output
...
@@ -535,7 +542,7 @@ time_asctime(PyObject *self, PyObject *args)
...
@@ -535,7 +542,7 @@ time_asctime(PyObject *self, PyObject *args)
p
=
asctime
(
&
buf
);
p
=
asctime
(
&
buf
);
if
(
p
[
24
]
==
'\n'
)
if
(
p
[
24
]
==
'\n'
)
p
[
24
]
=
'\0'
;
p
[
24
]
=
'\0'
;
return
Py
String
_FromString
(
p
);
return
Py
Unicode
_FromString
(
p
);
}
}
PyDoc_STRVAR
(
asctime_doc
,
PyDoc_STRVAR
(
asctime_doc
,
...
@@ -571,7 +578,7 @@ time_ctime(PyObject *self, PyObject *args)
...
@@ -571,7 +578,7 @@ time_ctime(PyObject *self, PyObject *args)
}
}
if
(
p
[
24
]
==
'\n'
)
if
(
p
[
24
]
==
'\n'
)
p
[
24
]
=
'\0'
;
p
[
24
]
=
'\0'
;
return
Py
String
_FromString
(
p
);
return
Py
Unicode
_FromString
(
p
);
}
}
PyDoc_STRVAR
(
ctime_doc
,
PyDoc_STRVAR
(
ctime_doc
,
...
...
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