diff --git a/engine/src/dsklnx.cpp b/engine/src/dsklnx.cpp index e9afc990583..1e143404b3d 100755 --- a/engine/src/dsklnx.cpp +++ b/engine/src/dsklnx.cpp @@ -1430,6 +1430,16 @@ class MCLinuxDesktop: public MCSystemInterface return MCStringCopy(*t_home, r_folder); else if (MCNameIsEqualTo(p_type, MCN_temporary, kMCCompareCaseless)) return MCStringCreateWithCString("/tmp", r_folder); + // SN-2014-08-08: [[ Bug 13026 ]] Fix ported from 6.7 + else if (MCNameIsEqualTo(p_type, MCN_engine, kMCCompareCaseless)) + { + uindex_t t_last_slash; + + if (!MCStringLastIndexOfChar(MCcmd, '/', UINDEX_MAX, kMCStringOptionCompareExact, t_last_slash)) + t_last_slash = MCStringGetLength(MCcmd); + + return MCStringCopySubstring(MCcmd, MCRangeMake(0, t_last_slash), r_folder) ? True : False; + } r_folder = MCValueRetain(kMCEmptyString); return true; diff --git a/engine/src/dskmac.cpp b/engine/src/dskmac.cpp index e807e186ffc..309fe5b0115 100644 --- a/engine/src/dskmac.cpp +++ b/engine/src/dskmac.cpp @@ -5310,6 +5310,18 @@ struct MCMacDesktop: public MCSystemInterface, public MCMacSystemService OSType t_domain = kOnAppropriateDisk; bool t_found_folder = false; + + // SN-2014-08-08: [[ Bug 13026 ]] Fix ported from 6.7 + if (MCNameIsEqualTo(p_type, MCN_engine, kMCCompareCaseless)) + { + uindex_t t_last_slash; + + if (!MCStringLastIndexOfChar(MCcmd, '/', UINDEX_MAX, kMCStringOptionCompareExact, t_last_slash)) + t_last_slash = MCStringGetLength(MCcmd); + + return MCStringCopySubstring(MCcmd, MCRangeMake(0, t_last_slash), r_folder) ? True : False; + } + if (MCS_mac_specialfolder_to_mac_folder(MCNameGetString(p_type), t_mac_folder, t_domain)) t_found_folder = true; else if (MCStringGetLength(MCNameGetString(p_type)) == 4 && diff --git a/engine/src/dskw32.cpp b/engine/src/dskw32.cpp index 50bce3644e9..f384e763bed 100644 --- a/engine/src/dskw32.cpp +++ b/engine/src/dskw32.cpp @@ -2693,6 +2693,16 @@ struct MCWindowsDesktop: public MCSystemInterface, public MCWindowsSystemService // ep.commit(strlen(buf)); //} //} + // SN-2014-08-08: [[ Bug 13026 ]] Fix ported from 6.7 + else if (MCNameIsEqualTo(p_type, MCN_engine, kMCCompareCaseless)) + { + uindex_t t_last_slash; + + if (!MCStringLastIndexOfChar(MCcmd, '/', UINDEX_MAX, kMCStringOptionCompareExact, t_last_slash)) + t_last_slash = MCStringGetLength(MCcmd); + + return MCStringCopySubstring(MCcmd, MCRangeMake(0, t_last_slash), r_folder) ? True : False; + } else { if (MCNumberParseUnicodeChars(MCStringGetCharPtr(MCNameGetString(p_type)), MCStringGetLength(MCNameGetString(p_type)), &t_special_folder) ||