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
378815ca
Kaydet (Commit)
378815ca
authored
Mar 06, 1996
tarafından
Jack Jansen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Replaced previous gusi-chdir() fix by a call to PyMac_FixGUSIcd()
after each chdir call.
üst
7275561d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
15 deletions
+48
-15
macglue.h
Mac/Include/macglue.h
+4
-0
macmodule.c
Mac/Modules/macmodule.c
+10
-0
macglue.c
Mac/Python/macglue.c
+30
-15
macmain.c
Mac/Python/macmain.c
+4
-0
No files found.
Mac/Include/macglue.h
Dosyayı görüntüle @
378815ca
...
...
@@ -39,6 +39,10 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#pragma lib_export on
#endif
#ifdef USE_GUSI
void
PyMac_FixGUSIcd
Py_PROTO
((
void
));
/* Workaround for GUSI chdir() call */
#endif
char
*
PyMac_StrError
(
int
);
/* strerror with mac errors */
extern
int
PyMac_DoYieldEnabled
;
/* Don't do eventloop when false */
...
...
Mac/Modules/macmodule.c
Dosyayı görüntüle @
378815ca
...
...
@@ -176,7 +176,17 @@ mac_chdir(self, args)
object
*
self
;
object
*
args
;
{
#ifdef USE_GUSI
object
*
rv
;
/* Change MacOS's idea of wd too */
rv
=
mac_1str
(
args
,
chdir
);
PyMac_FixGUSIcd
();
return
rv
;
#else
return
mac_1str
(
args
,
chdir
);
#endif
}
static
object
*
...
...
Mac/Python/macglue.c
Dosyayı görüntüle @
378815ca
...
...
@@ -51,6 +51,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#endif
#ifdef USE_GUSI
#include <TFileSpec.h>
/* For Path2FSSpec */
#include <LowMem.h>
/* For SetSFCurDir, etc */
#endif
#ifndef HAVE_UNIVERSAL_HEADERS
...
...
@@ -118,6 +119,34 @@ struct hook_args {
static
DlgHookYDUPP
myhook_upp
;
static
int
upp_inited
=
0
;
#ifdef USE_GUSI
/*
** GUSI (1.6.0 and earlier, at the least) do not set the MacOS idea of
** the working directory. Hence, we call this routine after each call
** to chdir() to rectify things.
*/
void
PyMac_FixGUSIcd
()
{
WDPBRec
pb
;
FSSpec
curdirfss
;
if
(
Path2FSSpec
(
":x"
,
&
curdirfss
)
!=
noErr
)
return
;
/* Set MacOS "working directory" */
pb
.
ioNamePtr
=
"\p"
;
pb
.
ioVRefNum
=
curdirfss
.
vRefNum
;
pb
.
ioWDDirID
=
curdirfss
.
parID
;
if
(
PBHSetVol
(
&
pb
,
0
)
!=
noErr
)
return
;
/* Set standard-file working directory */
LMSetSFSaveDisk
(
-
curdirfss
.
vRefNum
);
LMSetCurDirStore
(
curdirfss
.
parID
);
}
#endif
/* Convert C to Pascal string. Returns pointer to static buffer. */
unsigned
char
*
...
...
@@ -657,21 +686,8 @@ PyMac_GetFSSpec(PyObject *v, FSSpec *fs)
/* It's a pathname */
if
(
!
PyArg_Parse
(
v
,
"O&"
,
PyMac_GetStr255
,
&
path
)
)
return
0
;
#ifdef USE_GUSI
{
FSSpec
curdirfss
;
if
(
Path2FSSpec
(
":x"
,
&
curdirfss
)
==
0
)
{
refnum
=
curdirfss
.
vRefNum
;
parid
=
curdirfss
.
parID
;
}
else
{
return
0
;
}
}
#else
refnum
=
0
;
/* XXXX Should get CurWD here... */
refnum
=
0
;
/* XXXX Should get CurWD here?? */
parid
=
0
;
#endif
}
else
{
if
(
!
PyArg_Parse
(
v
,
"(hlO&); FSSpec should be fullpath or (vrefnum,dirid,path)"
,
&
refnum
,
&
parid
,
PyMac_GetStr255
,
&
path
))
{
...
...
@@ -687,7 +703,6 @@ PyMac_GetFSSpec(PyObject *v, FSSpec *fs)
}
/* Convert a Python object to a Rect.
The object must be a (left, top, right, bottom) tuple.
(This differs from the order in the struct but is consistent with
...
...
Mac/Python/macmain.c
Dosyayı görüntüle @
378815ca
...
...
@@ -192,6 +192,10 @@ PyMac_InitApplication()
*
endp
=
'\0'
;
chdir
(
curwd
);
#ifdef USE_GUSI
/* Change MacOS's idea of wd too */
PyMac_FixGUSIcd
();
#endif
}
}
Py_Main
(
argc
,
argv
);
...
...
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