summaryrefslogtreecommitdiff
path: root/bin/echo/echo.c
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/echo/echo.c
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/echo/echo.c')
-rw-r--r--bin/echo/echo.c29
1 files changed, 2 insertions, 27 deletions
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);