Improve error messages for the 'meas' command.

This commit is contained in:
Holger Vogt 2020-01-05 00:05:20 +01:00
parent 24cc13feaf
commit 13c5fd15b9
2 changed files with 9 additions and 3 deletions

View File

@ -1169,7 +1169,7 @@ measure_parse_stdParams(
wl = wl->wl_next;
continue;
} else {
sprintf(errbuf, "bad syntax of ??\n");
sprintf(errbuf, "bad syntax. equal sign missing ?\n");
return 0;
}
}
@ -1179,7 +1179,7 @@ measure_parse_stdParams(
}
else {
if (ft_numparse(&pValue, FALSE, &engVal1) < 0) {
sprintf(errbuf, "bad syntax of ??\n");
sprintf(errbuf, "bad syntax, cannot evaluate right hand side of %s=%s\n", pName, pValue);
return 0;
}
}
@ -1216,7 +1216,7 @@ measure_parse_stdParams(
}
if (pCnt == 0) {
sprintf(errbuf, "bad syntax of ??\n");
sprintf(errbuf, "bad syntax of %s\n", pName);
return 0;
}

View File

@ -67,6 +67,12 @@ com_meas(wordlist *wl)
May be in the next wl_word */
if (token[strlen(token) - 1] == '=') {
wl_index = wl_index->wl_next;
if (wl_index == NULL) {
line_in = wl_flatten(wl);
fprintf(stderr, "\nError: meas %s failed!\n\n", line_in);
tfree(line_in);
return;
}
vec_found = wl_index->wl_word;
/* token may be already a value, maybe 'LAST', which we have to keep, or maybe a vector */
if (!cieq(vec_found, "LAST")) {