From 6796698c9945d87236ffcc939137d0919ef04931 Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Tue, 27 Oct 2015 13:13:59 +0000 Subject: all: quote string arguments in error messages These strings are often file names or other user specified parameters, which can give confusing errors in the presence of unexpected characters for example. * cfg.mk (sc_error_quotes): A new syntax check rule. * src/*.c: Wrap error() string arguments with quote(). * tests/: Adjust accordingly. * NEWS: Mention the improvement. --- src/env.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/env.c') diff --git a/src/env.c b/src/env.c index 270d08e3b..681a6798a 100644 --- a/src/env.c +++ b/src/env.c @@ -156,6 +156,6 @@ main (int argc, char **argv) execvp (argv[optind], &argv[optind]); int exit_status = errno == ENOENT ? EXIT_ENOENT : EXIT_CANNOT_INVOKE; - error (0, errno, "%s", argv[optind]); + error (0, errno, "%s", quote (argv[optind])); return exit_status; } -- cgit v1.2.3-54-g00ecf