summaryrefslogtreecommitdiff
path: root/src/join.c
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2015-10-27 13:13:59 +0000
committerPádraig Brady <P@draigBrady.com>2015-10-27 17:24:54 +0000
commit6796698c9945d87236ffcc939137d0919ef04931 (patch)
treedd843e7808186887c2959451e34fdd7f42783359 /src/join.c
parent106d4bf159a97b573d6479473fa38216fb8bfada (diff)
downloadcoreutils-6796698c9945d87236ffcc939137d0919ef04931.tar.xz
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.
Diffstat (limited to 'src/join.c')
-rw-r--r--src/join.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/join.c b/src/join.c
index 52e4b18b3..ffef70f77 100644
--- a/src/join.c
+++ b/src/join.c
@@ -1183,18 +1183,18 @@ main (int argc, char **argv)
fp1 = STREQ (g_names[0], "-") ? stdin : fopen (g_names[0], "r");
if (!fp1)
- error (EXIT_FAILURE, errno, "%s", g_names[0]);
+ error (EXIT_FAILURE, errno, "%s", quote (g_names[0]));
fp2 = STREQ (g_names[1], "-") ? stdin : fopen (g_names[1], "r");
if (!fp2)
- error (EXIT_FAILURE, errno, "%s", g_names[1]);
+ error (EXIT_FAILURE, errno, "%s", quote (g_names[1]));
if (fp1 == fp2)
error (EXIT_FAILURE, errno, _("both files cannot be standard input"));
join (fp1, fp2);
if (fclose (fp1) != 0)
- error (EXIT_FAILURE, errno, "%s", g_names[0]);
+ error (EXIT_FAILURE, errno, "%s", quote (g_names[0]));
if (fclose (fp2) != 0)
- error (EXIT_FAILURE, errno, "%s", g_names[1]);
+ error (EXIT_FAILURE, errno, "%s", quote (g_names[1]));
if (issued_disorder_warning[0] || issued_disorder_warning[1])
return EXIT_FAILURE;