secnote

The secnote tool.
Commits | Files | Refs | README | LICENSE | git clone https://git.kore.io/secnote

commit 0d7efcb810169aa3826c65fe77b433ccd1865c86
parent c7272f733f854e645510f430b3faa5e7eaf2d2b3
Author: Joris Vink <joris@coders.se>
Date:   Mon, 13 Jun 2022 21:25:52 +0200

small fixes to output.

Diffstat:
secnote.c | 17++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/secnote.c b/secnote.c @@ -259,7 +259,8 @@ context_compare(struct context *verify, struct context *ondisk) if (t2 == NULL) { changes++; - printf("topic '%s' not found in new code\n", t1->name); + printf("topic '%s' not found in given source\n", + t1->name); topic_free(verify, t1); if (TAILQ_EMPTY(&verify->topics)) printf("\n"); @@ -1009,14 +1010,12 @@ text_topic_dump(struct context *ctx) text_topic_write(ctx, topic); else text_topic_header(ctx, topic); - - continue; + } else { + if (ctx->query == NULL || + fnmatch(ctx->query, topic->name, FNM_NOESCAPE) == 0) + text_topic_write(ctx, topic); } - if (ctx->query == NULL || - fnmatch(ctx->query, topic->name, FNM_NOESCAPE) == 0) - text_topic_write(ctx, topic); - topic_free(ctx, topic); } } @@ -1049,8 +1048,8 @@ text_topic_write(struct context *ctx, struct topic *topic) TAILQ_FOREACH(entry, &topic->entries, list) { if (ctx->list) { if (ctx->db) - printf("%s:%s:", entry->digest, entry->id); - printf("%s:%d-%d", entry->file, + printf("%s:", entry->digest); + printf("%s:%s:%d-%d", entry->id, entry->file, entry->line_start, entry->line_end); if (entry->context) printf(":%s", entry->context);