Skip to content
Browse files

Merge pull request #2716 from JoesCat/scripting_minion_check

Check for error on return from native scripting, fixes issue #2710
  • Loading branch information...
2 parents aa5a52a + 0be40b2 commit 7910965ca72b438474b031903549e4b0efba9643 @frank-trampe frank-trampe committed Apr 30, 2016
Showing with 3 additions and 2 deletions.
  1. +3 −2 fontforge/scripting.c
View
5 fontforge/scripting.c
@@ -8990,6 +8990,7 @@ static void docall(Context *c,char *name,Val *val) {
sub.curfv = c->curfv;
sub.trace = c->trace;
sub.dontfree = dontfree;
+ /* sub.error = ce_false = 0 = implied, no error yet */
for ( i=0; i<sub.a.argc; ++i ) {
dereflvalif(&args[i]);
if ( args[i].type == v_arrfree )
@@ -9070,7 +9071,7 @@ static void docall(Context *c,char *name,Val *val) {
docall_dofunc:
(found->func)(&sub);
docall_skipfunc:
- switch (c->error) {
+ switch (sub.error) { /* check if any error in results */
case ce_false: break;
case ce_true: break;
case ce_wrongnumarg:
@@ -9086,7 +9087,7 @@ docall_expectstr: ScriptError(&sub,"Expected string argument");
docall_expectint: ScriptError(&sub,"Expected integer argument");
break;
case ce_quit:
- exit(c->return_val.u.ival);
+ exit(sub.return_val.u.ival);
}
} else {
if ( strchr(name,'/')==NULL && strchr(c->filename,'/')!=NULL ) {

0 comments on commit 7910965

Please sign in to comment.
Something went wrong with that request. Please try again.