Fix and test for macLib losing error status
Problem found & diagnosed by Mark Rivers.
This commit is contained in:
@@ -857,9 +857,9 @@ static void refer ( MAC_HANDLE *handle, MAC_ENTRY *entry, int level,
|
||||
if ( !refentry->visited ) {
|
||||
/* reference is good, use it */
|
||||
if ( !handle->dirty ) {
|
||||
/* copy the already-expanded value, and its error status! */
|
||||
/* copy the already-expanded value, merge any error status */
|
||||
cpy2val( refentry->value, &v, valend );
|
||||
entry->error = refentry->error;
|
||||
entry->error = entry->error || refentry->error;
|
||||
} else {
|
||||
/* translate raw value */
|
||||
const char *rv = refentry->rawval;
|
||||
|
||||
@@ -65,7 +65,7 @@ static void ovcheck(void)
|
||||
|
||||
MAIN(macLibTest)
|
||||
{
|
||||
testPlan(89);
|
||||
testPlan(91);
|
||||
|
||||
if (macCreateHandle(&h, NULL))
|
||||
testAbort("macCreateHandle() failed");
|
||||
@@ -203,6 +203,9 @@ MAIN(macLibTest)
|
||||
/* STR2 = "VAL2" */
|
||||
check("${FOO}", " VAL2");
|
||||
|
||||
check("$(FOO)$(FOO1)", "!VAL2$(FOO1,undefined)");
|
||||
check("$(FOO1)$(FOO)", "!$(FOO1,undefined)VAL2");
|
||||
|
||||
macPutValue(h, "BAR","${FOO}");
|
||||
/* FOO = "${BAR}" */
|
||||
/* BAR = "${FOO}" */
|
||||
|
||||
Reference in New Issue
Block a user