- fixed error handling
This commit is contained in:
10
pardef.c
10
pardef.c
@ -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;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
Reference in New Issue
Block a user