mainloop: Add some helpful comments
Added a couple helpful comments that save someone
from reading the code and thinking about it to know
what it does.
Change-Id: Ieac770e99fbd75a42be6803ee7959aba6ad6e96a
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/mainloop.cpp b/mainloop.cpp
index c93beb8..62467fd 100644
--- a/mainloop.cpp
+++ b/mainloop.cpp
@@ -450,12 +450,15 @@
_isOCC = true;
}
+ // Strip off any trailing slashes.
std::string p = path;
while (!p.empty() && p.back() == '/')
{
p.pop_back();
}
+ // Given the furthest right /, set instance to
+ // the basename, and hwmonRoot to the leading path.
auto n = p.rfind('/');
if (n != std::string::npos)
{