calc backward compatibility: allow incomplete conditional

This commit is contained in:
2020-11-12 10:54:11 +01:00
parent 48d37e6b45
commit 1d1e3e9527

View File

@@ -216,6 +216,7 @@ LIBCOM_API long
int cond_count = 0;
char * const pdest = pout;
char *pnext;
const char* psrc_orig = psrc;
if (psrc == NULL || *psrc == '\0' ||
pout == NULL || perror == NULL) {
@@ -470,8 +471,12 @@ LIBCOM_API long
*pout = END_EXPRESSION;
if (cond_count != 0) {
fprintf(stderr, "Deprecated CALC \"%s\": %s\n",
psrc_orig, calcErrorStr(CALC_ERR_CONDITIONAL));
/*
*perror = CALC_ERR_CONDITIONAL;
goto bad;
*/
}
if (operand_needed || runtime_depth != 1) {
*perror = CALC_ERR_INCOMPLETE;