Skip to content

Commit 34ef614

Browse files
[[ RefactorSyntax ]] Fixes externals creation from the 'deploy' command
1 parent 0896787 commit 34ef614

2 files changed

Lines changed: 13 additions & 7 deletions

File tree

engine/src/deploy.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,16 @@ bool MCDeployParameters::InitWithArray(MCExecContext &ctxt, MCArrayRef p_array)
123123
MCValueAssign(auxillary_stackfiles, t_temp_array);
124124
MCValueRelease(t_temp_array);
125125

126-
if (!ctxt.CopyOptElementAsArray(p_array, MCNAME("externals"), false, t_temp_array))
127-
return false;
128-
MCValueAssign(externals, t_temp_array);
129-
MCValueRelease(t_temp_array);
126+
if (!ctxt.CopyOptElementAsString(p_array, MCNAME("externals"), false, t_temp_string))
127+
return false;
128+
if (!MCStringIsEmpty(t_temp_string))
129+
{
130+
MCStringSplit(t_temp_string, MCSTR("\n"), nil, kMCStringOptionCompareExact, t_temp_array);
131+
MCValueAssign(externals, t_temp_array);
132+
MCValueRelease(t_temp_array);
133+
}
134+
else
135+
MCValueAssign(externals, kMCEmptyArray);
130136

131137
if (!ctxt.CopyOptElementAsString(p_array, MCNAME("startup_script"), false, t_temp_string))
132138
return false;

engine/src/deploy_capsule.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,11 @@ bool MCDeployCapsuleDefine(MCDeployCapsuleRef self, MCCapsuleSectionType p_type,
185185

186186
bool MCDeployCapsuleDefineString(MCDeployCapsuleRef self, MCCapsuleSectionType p_type, MCStringRef p_string)
187187
{
188-
MCAutoStringRefAsNativeChars t_auto_native;
188+
MCAutoStringRefAsCString t_auto_cstring;
189189
uindex_t t_length;
190190
char_t* t_native;
191-
/* UNCHECKED */ t_auto_native . Lock(p_string, t_native, t_length);
192-
return MCDeployCapsuleDefine(self, p_type, t_native, t_length);
191+
/* UNCHECKED */ t_auto_cstring . Lock(p_string);
192+
return MCDeployCapsuleDefine(self, p_type, *t_auto_cstring, strlen(*t_auto_cstring) + 1);
193193
}
194194

195195
bool MCDeployCapsuleDefineFromFile(MCDeployCapsuleRef self, MCCapsuleSectionType p_type, MCDeployFileRef p_file)

0 commit comments

Comments
 (0)