Skip to content

Commit 6e9bc33

Browse files
committed
Merge pull request livecode#550 from runrevsebastien/bugfix-11950
[[ Bug 11950 ]] mark card does not work
2 parents 75ec9d3 + cbd3030 commit 6e9bc33

2 files changed

Lines changed: 29 additions & 19 deletions

File tree

docs/notes/bugfix-11950.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# mark card does not work

engine/src/cmds.cpp

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,32 +1100,41 @@ void MCMarking::exec_ctxt(MCExecContext &ctxt)
11001100
else
11011101
MCInterfaceExecUnmarkCard(ctxt, t_object);
11021102
}
1103-
if (tofind == nil)
1104-
if (mark)
1103+
// SN-2014-03-21 [[ Bug 11950 ]]: 'mark' shouldn't throw an error when failing to mark when card is nil
1104+
// Any error set is discarded in the end of this block - unless is was triggered by a bad string.
1105+
else
1106+
{
1107+
if (tofind == nil)
11051108
{
1106-
if (where != nil)
1107-
MCInterfaceExecMarkCardsConditional(ctxt, where);
1109+
if (mark)
1110+
{
1111+
if (where != nil)
1112+
MCInterfaceExecMarkCardsConditional(ctxt, where);
1113+
else
1114+
MCInterfaceExecMarkAllCards(ctxt);
1115+
}
11081116
else
1109-
MCInterfaceExecMarkAllCards(ctxt);
1117+
{
1118+
if (where != nil)
1119+
MCInterfaceExecUnmarkCardsConditional(ctxt, where);
1120+
else
1121+
MCInterfaceExecUnmarkAllCards(ctxt);
1122+
}
11101123
}
11111124
else
11121125
{
1113-
if (where != nil)
1114-
MCInterfaceExecUnmarkCardsConditional(ctxt, where);
1126+
MCAutoStringRef t_needle;
1127+
1128+
if (!ctxt . EvalExprAsStringRef(tofind, EE_MARK_BADSTRING, &t_needle))
1129+
return;
1130+
1131+
if (mark)
1132+
MCInterfaceExecMarkFind(ctxt, mode, *t_needle, field);
11151133
else
1116-
MCInterfaceExecUnmarkAllCards(ctxt);
1134+
MCInterfaceExecUnmarkFind(ctxt, mode, *t_needle, field);
11171135
}
1118-
else
1119-
{
1120-
MCAutoStringRef t_needle;
1121-
1122-
if (!ctxt . EvalExprAsStringRef(tofind, EE_MARK_BADSTRING, &t_needle))
1123-
return;
1124-
1125-
if (mark)
1126-
MCInterfaceExecMarkFind(ctxt, mode, *t_needle, field);
1127-
else
1128-
MCInterfaceExecUnmarkFind(ctxt, mode, *t_needle, field);
1136+
1137+
ctxt . IgnoreLastError();
11291138
}
11301139
}
11311140

0 commit comments

Comments
 (0)