- fixed error handling

This commit is contained in:
zolliker
2013-06-07 06:50:59 +00:00
parent dedfa6fbe9
commit 343ebb2ab0
2 changed files with 15 additions and 11 deletions

View File

@ -27,6 +27,7 @@ Markus Zolliker, March 2005
#define BADLOG -6
#define UNKPAR -7
#define PARUNDEF -8
#define ERRCMD -9
typedef enum { NO_OP, FMT_OP, SET_OP, GET_OP, INIT_OP } ParOp;
@ -1390,8 +1391,13 @@ int ParCmd(ParCommand cmd, void *userarg)
ctx->action = PAR_NOOP;
return 0;
}
ctx->returnValue = 1;
return cmd(ctx->obj, userarg, ctx->argc, ctx->argv);
iret = cmd(ctx->obj, userarg, ctx->argc, ctx->argv);
if (iret == 0) {
ctx->returnValue = ERRCMD;
return -1;
}
ctx->returnValue = iret;
return 1;
}
/*----------------------------------------------------------------------------*/