Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit bcf048f

Browse files
author
runrevali
committed
Revert "Merge pull request #980 from runrevali/bugfix-13026-7_0"
This reverts commit e461c13, reversing changes made to ad95dea.
1 parent e461c13 commit bcf048f

2 files changed

Lines changed: 6 additions & 40 deletions

File tree

engine/src/dskmac.cpp

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
#include <Security/Authorization.h>
5555
#include <Security/AuthorizationTags.h>
5656

57-
#include <mach-o/dyld.h>
5857

5958
#define ENTRIES_CHUNK 1024
6059

@@ -657,9 +656,7 @@ static sysfolders sysfolderlist[] = {
657656
// MW-2007-09-11: Added for uniformity across platforms
658657
{&MCN_documents, 'docs', kUserDomain, 'docs'},
659658
// MW-2007-10-08: [[ Bug 10277 ] Add support for the 'application support' at user level.
660-
// SN-2014-07-30: [[ Bug 13026 ]] We don't want any folder which doesn't match one above
661-
// to return the Application Support folder
662-
{&MCN_support, 'asup', kUserDomain, 'asup'},
659+
{&MCN_support, 0, kUserDomain, 'asup'},
663660
};
664661

665662
static bool MCS_mac_specialfolder_to_mac_folder(MCStringRef p_type, uint32_t& r_folder, OSType& r_domain)
@@ -5442,10 +5439,6 @@ struct MCMacDesktop: public MCSystemInterface, public MCMacSystemService
54425439
const char *t_error;
54435440
t_error = NULL;
54445441

5445-
// SN-2014-07-30: [[ 13026 ]] We can get the engine folder on desktop as well
5446-
char *t_folder_path;
5447-
t_folder_path = NULL;
5448-
54495442
FSRef t_folder_ref;
54505443
if (t_error == NULL)
54515444
{
@@ -5458,15 +5451,8 @@ struct MCMacDesktop: public MCSystemInterface, public MCMacSystemService
54585451
memcpy(&t_mac_folder, p_context . getsvalue() . getstring(), 4);
54595452
t_mac_folder = MCSwapInt32NetworkToHost(t_mac_folder);
54605453
}
5461-
else if (p_context . getsvalue() == "engine")
5462-
{
5463-
extern char *MCcmd;
5464-
char* t_folder;
5465-
t_folder_path = strndup(MCcmd, strrchr(MCcmd, '/') - MCcmd);
5466-
5454+
else
54675455
t_mac_folder = 0;
5468-
t_found_folder = true;
5469-
}
54705456

54715457
OSErr t_os_error;
54725458
uint2 t_i;
@@ -5497,9 +5483,10 @@ struct MCMacDesktop: public MCSystemInterface, public MCMacSystemService
54975483
if (!t_found_folder)
54985484
t_error = "folder not found";
54995485
}
5500-
5501-
// SN-2014-07-30: [[ Bug 13026 ]] If the engine was asked, the folder path is directly set
5502-
if (t_error == NULL && t_folder_path == NULL)
5486+
5487+
char *t_folder_path;
5488+
t_folder_path = NULL;
5489+
if (t_error == NULL)
55035490
{
55045491
t_folder_path = MCS_fsref_to_path(t_folder_ref);
55055492
if (t_folder_path == NULL)
@@ -5529,14 +5516,6 @@ struct MCMacDesktop: public MCSystemInterface, public MCMacSystemService
55295516
t_domain = kOnAppropriateDisk;
55305517
t_found_folder = true;
55315518
}
5532-
else if (MCNameIsEqualTo(p_type, MCN_engine))
5533-
{
5534-
extern MCStringRef MCcmd;
5535-
uindex_t t_last_slash;
5536-
if (!MCStringLastIndexOfChar(MCcmd, '/', UINDEX_MAX, kMCCompareCaseless, t_last_slash))
5537-
t_last_slash = MCStringGetLength(MCcmd);
5538-
return MCStringCopySubstring(MCcmd, MCRangeMake(0, t_last_slash), r_folder);
5539-
}
55405519

55415520
FSRef t_folder_ref;
55425521
if (t_found_folder)

engine/src/dskw32.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2682,19 +2682,6 @@ struct MCWindowsDesktop: public MCSystemInterface, public MCWindowsSystemService
26822682
t_wasfound = true;
26832683
}
26842684
}
2685-
}
2686-
// SN-2014-07-30: [[ Bug 13026 ]] specialFolderPath("engine") added for Windows
2687-
else if (MCNameIsEqualTo(p_type, MCN_engine))
2688-
{
2689-
extern MCStringRef MCcmd;
2690-
uindex_t t_last_slash;
2691-
if (!MCStringLastIndexOfChar(MCcmd, '/', UINDEX_MAX, kMCCompareCaseless, t_last_slash))
2692-
t_last_slash = MCStringGetLength(MCcmd);
2693-
MCAutoStringRef t_path;
2694-
if (!MCStringCopySubstring(MCcmd, MCRangeMake(0, t_last_slash), &t_path) ||
2695-
!MCU_path2native(*t_path, &t_native_path))
2696-
return false;
2697-
t_wasfound = true;
26982685
}
26992686
//else if (MCStringIsEqualTo(p_special, MCNameGetString(MCN_system), kMCStringOptionCompareCaseless))
27002687
//{

0 commit comments

Comments
 (0)