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
214d39a0
Kaydet (Commit)
214d39a0
authored
Ock 02, 2003
tarafından
Andrew MacIntyre
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
catch up with zipimport changes to std getpathp.c
üst
5180123a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
3 deletions
+25
-3
getpathp.c
PC/os2emx/getpathp.c
+25
-3
No files found.
PC/os2emx/getpathp.c
Dosyayı görüntüle @
214d39a0
...
...
@@ -250,6 +250,8 @@ calculate_path(void)
size_t
bufsz
;
char
*
pythonhome
=
Py_GetPythonHome
();
char
*
envpath
=
getenv
(
"PYTHONPATH"
);
char
zip_path
[
MAXPATHLEN
+
1
];
size_t
len
;
get_progpath
();
/* progpath guaranteed \0 terminated in MAXPATH+1 bytes. */
...
...
@@ -267,12 +269,26 @@ calculate_path(void)
if
(
envpath
&&
*
envpath
==
'\0'
)
envpath
=
NULL
;
/* Calculate zip archive path */
strncpy
(
zip_path
,
progpath
,
MAXPATHLEN
);
zip_path
[
MAXPATHLEN
]
=
'\0'
;
len
=
strlen
(
zip_path
);
if
(
len
>
4
)
{
zip_path
[
len
-
3
]
=
'z'
;
/* change ending to "zip" */
zip_path
[
len
-
2
]
=
'i'
;
zip_path
[
len
-
1
]
=
'p'
;
}
else
{
zip_path
[
0
]
=
0
;
}
/* We need to construct a path from the following parts.
(1) the PYTHONPATH environment variable, if set;
(2) the PYTHONPATH config macro, with the leading "."
(2) the zip archive file path;
(3) the PYTHONPATH config macro, with the leading "."
of each component replaced with pythonhome, if set;
(
3
) the directory containing the executable (argv0_path).
The length calculation calculates #
2
first.
(
4
) the directory containing the executable (argv0_path).
The length calculation calculates #
3
first.
*/
/* Calculate size of return buffer */
...
...
@@ -289,6 +305,7 @@ calculate_path(void)
bufsz
=
0
;
bufsz
+=
strlen
(
PYTHONPATH
)
+
1
;
bufsz
+=
strlen
(
argv0_path
)
+
1
;
bufsz
+=
strlen
(
zip_path
)
+
1
;
if
(
envpath
!=
NULL
)
bufsz
+=
strlen
(
envpath
)
+
1
;
...
...
@@ -312,6 +329,11 @@ calculate_path(void)
buf
=
strchr
(
buf
,
'\0'
);
*
buf
++
=
DELIM
;
}
if
(
zip_path
[
0
])
{
strcpy
(
buf
,
zip_path
);
buf
=
strchr
(
buf
,
'\0'
);
*
buf
++
=
DELIM
;
}
if
(
pythonhome
==
NULL
)
{
strcpy
(
buf
,
PYTHONPATH
);
...
...
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