Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e1d8c9b

Browse files
committed
Fixed FSSpec->pathname code to add colon if the fsspec points to a disk.
1 parent 56c3c76 commit e1d8c9b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Mac/Python/macgetargv.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,12 @@ PyMac_GetFullPath (FSSpec *fss, char *buf)
139139
plen = fss_current.name[0];
140140
memcpy(buf, &fss_current.name[1], plen);
141141
buf[plen] = 0;
142+
/* Special case for disk names */
143+
if ( fss_current.parID <= 1 ) {
144+
buf[plen++] = ':';
145+
buf[plen] = 0;
146+
return 0;
147+
}
142148
while (fss_current.parID > 1) {
143149
/* Get parent folder name */
144150
if (err = get_folder_parent(&fss_current, &fss_parent))

0 commit comments

Comments
 (0)