Skip to content

inspect-library: various fixes

Simon McVittie requested to merge wip/smcv/inspect-library-fixes into master

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.

Merge request reports