From 5f49677d763607ae8624eb9fc6933ce7cf871811 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 11 Feb 2024 16:46:07 -0500 Subject: Bugfix for string literals and add support for printing patterns with --verbose --- bp.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'bp.c') diff --git a/bp.c b/bp.c index 68c07d0..3f17736 100644 --- a/bp.c +++ b/bp.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -558,6 +559,9 @@ int main(int argc, char *argv[]) { char *flag = NULL; + if (set_pattern_printf_specifier('P')) + errx(1, "Couldn't set printf specifier"); + pat_t *defs = NULL; file_t *loaded_files = NULL; pat_t *pattern = NULL; @@ -678,6 +682,9 @@ int main(int argc, char *argv[]) // Handle exit() calls gracefully: require(atexit(&cleanup), "Failed to set cleanup handler at exit"); + if (options.verbose) + printf("Matching pattern: %P\n", pattern); + int found = 0; if (options.mode == MODE_JSON) printf("["); if (options.git_mode) { // Get the list of files from `git --ls-files ...` -- cgit v1.2.3