From 3824f572ef030a4ed77353e05ed3ba3b87fb956b Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Tue, 17 Sep 2019 21:41:48 +0300 Subject: [PATCH] LibC: Ensure getopt error messages end with a newline This is what POSIX seems to specify, and also what glibc getopt does. --- Libraries/LibC/getopt.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Libraries/LibC/getopt.cpp b/Libraries/LibC/getopt.cpp index 2b59d65986..8dd54a53af 100644 --- a/Libraries/LibC/getopt.cpp +++ b/Libraries/LibC/getopt.cpp @@ -113,16 +113,16 @@ static int nonopt_start = -1; /* first non option argument (for permute) */ static int nonopt_end = -1; /* first option after non options (for permute) */ /* Error messages */ -static const char recargchar[] = "option requires an argument -- %c"; -static const char illoptchar[] = "illegal option -- %c"; /* From P1003.2 */ +static const char recargchar[] = "option requires an argument -- %c\n"; +static const char illoptchar[] = "illegal option -- %c\n"; /* From P1003.2 */ static int dash_prefix = NO_PREFIX; -static const char gnuoptchar[] = "invalid option -- %c"; +static const char gnuoptchar[] = "invalid option -- %c\n"; -static const char recargstring[] = "option `%s%s' requires an argument"; -static const char ambig[] = "option `%s%.*s' is ambiguous"; -static const char noarg[] = "option `%s%.*s' doesn't allow an argument"; -static const char illoptstring[] = "unrecognized option `%s%s'"; +static const char recargstring[] = "option `%s%s' requires an argument\n"; +static const char ambig[] = "option `%s%.*s' is ambiguous\n"; +static const char noarg[] = "option `%s%.*s' doesn't allow an argument\n"; +static const char illoptstring[] = "unrecognized option `%s%s'\n"; /* * Compute the greatest common divisor of a and b.