From d3263f0f1a714f79e4063690a79c0876581ab2e8 Mon Sep 17 00:00:00 2001 From: david Date: Thu, 29 May 2008 20:05:02 +0000 Subject: [PATCH] Fix grepable output "Ignored State" reporting. Only one ignored state (the one with the highest numbers of ports) is output. --- output.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/output.cc b/output.cc index 449fabfad..82d4a3fde 100644 --- a/output.cc +++ b/output.cc @@ -751,8 +751,12 @@ void printportoutput(Target *currenths, PortList *plist) { } /* log_write(LOG_PLAIN,"\n"); */ - if (plist->getStateCounts(istate) > 0) - log_write(LOG_MACHINE, "\tIgnored State: %s (%d)", statenum2str(istate), plist->getStateCounts(istate)); + /* Grepable output supports only one ignored state. */ + if (plist->numIgnoredStates() == 1) { + istate = plist->nextIgnoredState(PORT_UNKNOWN); + if (plist->getStateCounts(istate) > 0) + log_write(LOG_MACHINE, "\tIgnored State: %s (%d)", statenum2str(istate), plist->getStateCounts(istate)); + } log_write(LOG_XML, "\n"); // Now we write the table for the user