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
677898a3
Kaydet (Commit)
677898a3
authored
Mar 02, 2001
tarafından
Tim Peters
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Thanks to Steven Majewski, finally putting MacOS X imports to bed for 2.1b1.
üst
fd85a4e6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
9 deletions
+3
-9
import.c
Python/import.c
+3
-9
No files found.
Python/import.c
Dosyayı görüntüle @
677898a3
...
...
@@ -1118,14 +1118,7 @@ case_ok(char *buf, int len, int namelen, char *name)
return
fss
.
name
[
0
]
>=
namelen
&&
strncmp
(
name
,
(
char
*
)
fss
.
name
+
1
,
namelen
)
==
0
;
/* new-fangled macintosh (macosx)
*
* XXX This seems prone to obscure errors, like suppose someone does
* XXX "import xyz", and in some directory there's both "XYZ.py" and
* XXX "xyz.txt". fopen("xyz.py") will open XYZ.py, but when marching thru
* XXX the directory we'll eventually "succeed" on "xyz.txt" because the
* XXX extension is never checked.
*/
/* new-fangled macintosh (macosx) */
#elif defined(__MACH__) && defined(__APPLE__) && defined(HAVE_DIRENT_H)
DIR
*
dirp
;
struct
dirent
*
dp
;
...
...
@@ -1148,6 +1141,7 @@ case_ok(char *buf, int len, int namelen, char *name)
/* Open the directory and search the entries for an exact match. */
dirp
=
opendir
(
dirname
);
if
(
dirp
)
{
char
*
nameWithExt
=
buf
+
len
-
namelen
;
while
((
dp
=
readdir
(
dirp
))
!=
NULL
)
{
const
int
thislen
=
#ifdef _DIRENT_HAVE_D_NAMELEN
...
...
@@ -1156,7 +1150,7 @@ case_ok(char *buf, int len, int namelen, char *name)
strlen
(
dp
->
d_name
);
#endif
if
(
thislen
>=
namelen
&&
str
ncmp
(
dp
->
d_name
,
name
,
namelen
)
==
0
)
{
str
cmp
(
dp
->
d_name
,
nameWithExt
)
==
0
)
{
(
void
)
closedir
(
dirp
);
return
1
;
/* Found */
}
...
...
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