summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorKiyoshi Aman <kiyoshi.aman+adelie@gmail.com>2019-05-19 07:38:31 -0500
committerKiyoshi Aman <kiyoshi.aman+adelie@gmail.com>2019-05-19 07:38:31 -0500
commitd50a3cfe49d6ab7aa1db8380dde1508cafe67b7d (patch)
tree3325d0c25f65e7dbc99b5a0dc0fcc5f0d269e32a /bin
parentd4262d57368f86161a4cf5175180039a806612a0 (diff)
downloaduserland-d50a3cfe49d6ab7aa1db8380dde1508cafe67b7d.tar.gz
userland-d50a3cfe49d6ab7aa1db8380dde1508cafe67b7d.tar.bz2
userland-d50a3cfe49d6ab7aa1db8380dde1508cafe67b7d.tar.xz
userland-d50a3cfe49d6ab7aa1db8380dde1508cafe67b7d.zip
bin/echo: build against libbsd, make strictly conformant
Diffstat (limited to 'bin')
-rw-r--r--bin/echo/echo.116
-rw-r--r--bin/echo/echo.c29
2 files changed, 4 insertions, 41 deletions
diff --git a/bin/echo/echo.1 b/bin/echo/echo.1
index a7e374b..81156d5 100644
--- a/bin/echo/echo.1
+++ b/bin/echo/echo.1
@@ -40,8 +40,6 @@
.Nd write arguments to the standard output
.Sh SYNOPSIS
.Nm
-.Op Fl n
-.Op Ar string ...
.Sh DESCRIPTION
The
.Nm
@@ -50,22 +48,12 @@ characters and followed by a newline (``\en'') character, to the standard
output.
.Pp
The following option is available:
-.Bl -tag -width flag
-.It Fl n
-Do not print the trailing newline character.
.El
.Sh EXIT STATUS
.Ex -std echo
.Sh SEE ALSO
.Xr printf 1
-.Sh STANDARDS
+.Sh CONFORMANCE
The
.Nm
-utility is expected to be
-.St -p1003.2
-compatible.
-.Sh HISTORY
-An
-.Nm
-utility appeared in
-.At v2 .
+utility is strictly conformant to POSIX.1-2017.
diff --git a/bin/echo/echo.c b/bin/echo/echo.c
index 2e59363..73e1fe0 100644
--- a/bin/echo/echo.c
+++ b/bin/echo/echo.c
@@ -29,50 +29,25 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-#ifndef lint
-__COPYRIGHT(
-"@(#) Copyright (c) 1989, 1993\
- The Regents of the University of California. All rights reserved.");
-#endif /* not lint */
-
-#ifndef lint
-#if 0
-static char sccsid[] = "@(#)echo.c 8.1 (Berkeley) 5/31/93";
-#else
-__RCSID("$NetBSD: echo.c,v 1.19 2016/09/05 01:00:07 sevan Exp $");
-#endif
-#endif /* not lint */
-
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
+#include <bsd/stdlib.h>
#include <string.h>
/* ARGSUSED */
int
main(int argc, char *argv[])
{
- int nflag;
-
setprogname(argv[0]);
(void)setlocale(LC_ALL, "");
- /* This utility may NOT do getopt(3) option parsing. */
- if (*++argv && !strcmp(*argv, "-n")) {
- ++argv;
- nflag = 1;
- }
- else
- nflag = 0;
-
while (*argv) {
(void)printf("%s", *argv);
if (*++argv)
(void)putchar(' ');
}
- if (nflag == 0)
- (void)putchar('\n');
+ (void)putchar('\n');
fflush(stdout);
if (ferror(stdout))
exit(1);