diff --git a/src/libCom/macLib/macCore.c b/src/libCom/macLib/macCore.c index 02c8da765..dea4a061b 100644 --- a/src/libCom/macLib/macCore.c +++ b/src/libCom/macLib/macCore.c @@ -259,9 +259,10 @@ epicsShareAPI macPutValue( * a macro from all scopes will still be needed by iocshEnvClear */ while ( ( entry = lookup( handle, name, FALSE ) ) != NULL ) { + int done = strcmp(entry->type, "environment variable") == 0; delete( handle, entry ); - if (strcmp(entry->type, "environment variable") == 0) + if (done) break; }