inspect-library: various fixes
While looking into whether we could support deb-symbols(5) in inspect-library, I noticed some weirdness in the parser.
-
inspect-library: Make memory management more obvious
We were relying on the fact that strsep(&line, ...) resets line to NULL when it reaches the end, which is not at all obvious. Swap the roles of the variables around.
-
inspect-library: Reuse a buffer between iterations
There's no point in freeing the buffer every time: getline() is designed to reuse it.
-
inspect-library: Allow just a symbol on a line, with no @
Previously, we would have accepted this as not a parse error, and then crashed with strcmp(NULL, ...) when we tried to use it.
It obviously ought to mean the same thing as @Base, so treat it the same.