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
f74c36c9
Kaydet (Commit)
f74c36c9
authored
Şub 21, 1995
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fix bug with volume root
üst
24a45e3c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
20 deletions
+22
-20
nfullpath.c
Mac/Compat/nfullpath.c
+22
-20
No files found.
Mac/Compat/nfullpath.c
Dosyayı görüntüle @
f74c36c9
/* GET FULL PATHNAME OF A FILE.
** Original by Guido, modified by Jack to handle FSSpecs
** (and only tested under MetroWerks, so far)
*/
#include <string.h>
...
...
@@ -12,7 +11,6 @@
/* Mac file system parameters */
#define MAXPATH 256
/* Max path name length+1 */
#define SEP ':'
/* Separator in path names */
#define ROOTID 2
/* DirID of a volume's root directory */
/* Macro to find out whether we can do HFS-only calls: */
#define FSFCBLen (* (short *) 0x3f6)
...
...
@@ -29,45 +27,49 @@ nfullpath(fsp, retbuf)
WDPBRec
w
;
VolumeParam
v
;
}
pb
;
static
char
cwd
[
2
*
MAXPATH
];
char
cwd
[
2
*
MAXPATH
];
unsigned
char
namebuf
[
MAXPATH
];
short
err
;
int
dir
;
long
dirid
;
char
*
next
=
cwd
+
sizeof
cwd
-
1
;
char
*
next
=
cwd
+
sizeof
cwd
-
1
;
int
len
;
int
need_sep
=
1
;
if
(
!
hfsrunning
())
return
-
1
;
dir
=
fsp
->
vRefNum
;
dir
=
fsp
->
vRefNum
;
dirid
=
fsp
->
parID
;
/* Stuff the filename into the buffer */
len
=
fsp
->
name
[
0
];
*
next
=
'\0'
;
next
-=
len
+
1
;
memcpy
(
next
,
&
fsp
->
name
[
1
]
,
len
);
next
-=
len
;
memcpy
(
next
,
fsp
->
name
+
1
,
len
);
for
(;;
)
{
pb
.
d
.
ioNamePtr
=
namebuf
;
pb
.
d
.
ioVRefNum
=
dir
;
pb
.
d
.
ioFDirIndex
=
-
1
;
pb
.
d
.
ioDrDirID
=
dirid
;
while
(
dirid
!=
fsRtParID
)
{
pb
.
d
.
ioNamePtr
=
namebuf
;
pb
.
d
.
ioVRefNum
=
dir
;
pb
.
d
.
ioFDirIndex
=
-
1
;
pb
.
d
.
ioDrDirID
=
dirid
;
err
=
PBGetCatInfo
((
CInfoPBPtr
)
&
pb
.
d
,
0
);
if
(
err
!=
noErr
)
{
if
(
err
!=
noErr
)
return
err
;
}
*--
next
=
SEP
;
len
=
namebuf
[
0
];
*--
next
=
SEP
;
len
=
namebuf
[
0
];
if
(
len
+
strlen
(
next
)
>=
MAXPATH
)
return
-
1
;
next
-=
len
;
memcpy
(
next
,
(
char
*
)
namebuf
+
1
,
len
);
if
(
pb
.
d
.
ioDrDirID
==
ROOTID
)
break
;
dirid
=
pb
.
d
.
ioDrParID
;
dirid
=
pb
.
d
.
ioDrParID
;
need_sep
=
0
;
}
strcpy
(
retbuf
,
next
);
if
(
need_sep
)
{
next
=
strchr
(
retbuf
,
'\0'
);
*
next
++
=
SEP
;
*
next
++
=
'\0'
;
}
return
0
;
}
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