diff options
| author | Rich Burridge <rich.burridge@oracle.com> | 2010-07-15 13:45:49 -0700 |
|---|---|---|
| committer | Rich Burridge <rich.burridge@oracle.com> | 2010-07-15 13:45:49 -0700 |
| commit | cc22b130832529204c03214239a57aaadd05101f (patch) | |
| tree | dcc5bd0451338b3ba21f6e117c30c6ca3e1e3365 /usr/src/cmd/echo | |
| parent | 61694e455782cfdf91b3acf3db84f502546f92e1 (diff) | |
| download | illumos-joyent-cc22b130832529204c03214239a57aaadd05101f.tar.gz | |
PSARC 2010/233 EOF SYSV3 SCO compatibility environment variable
6961744 EOF SYSV3 SCO compatibility environment variable
Diffstat (limited to 'usr/src/cmd/echo')
| -rw-r--r-- | usr/src/cmd/echo/Makefile | 14 | ||||
| -rw-r--r-- | usr/src/cmd/echo/echo.c | 35 |
2 files changed, 11 insertions, 38 deletions
diff --git a/usr/src/cmd/echo/Makefile b/usr/src/cmd/echo/Makefile index fbd23ae9c6..afe47998d6 100644 --- a/usr/src/cmd/echo/Makefile +++ b/usr/src/cmd/echo/Makefile @@ -2,9 +2,8 @@ # CDDL HEADER START # # The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. @@ -19,11 +18,7 @@ # # CDDL HEADER END # -# -#ident "%Z%%M% %I% %E% SMI" -# -# Copyright 2004 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. +# Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved. # PROG= echo @@ -32,9 +27,6 @@ include ../Makefile.cmd CFLAGS += $(CCVERBOSE) -# This flag is being added only for SCO (x86) compatibility -CFLAGS += $(iBCS2FLAG) - .KEEP_STATE: all: $(PROG) diff --git a/usr/src/cmd/echo/echo.c b/usr/src/cmd/echo/echo.c index 1a0cf70682..ebd8e3868b 100644 --- a/usr/src/cmd/echo/echo.c +++ b/usr/src/cmd/echo/echo.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,12 +19,9 @@ * CDDL HEADER END */ /* - * Copyright 2003 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ @@ -47,9 +43,6 @@ main(int argc, char *argv[]) int b_len; char *ep; -#ifdef _iBCS2 - int no_nl = 0; -#endif (void) setlocale(LC_ALL, ""); if (--argc == 0) { @@ -59,18 +52,9 @@ main(int argc, char *argv[]) return (0); } -#ifdef _iBCS2 - /* If SYSV3 is set, check for ISC/SCO style -n option parsing. */ - if (getenv("SYSV3")) { - if (strcmp(argv[1], "-n") == 0) - no_nl ++; - } - for (i = 1 + no_nl; i <= argc; i++) { -#else for (i = 1; i <= argc; i++) { -#endif /* _iBCS2 */ for (cp = argv[i], ep = cp + (int)strlen(cp); - cp < ep; cp += b_len) { + cp < ep; cp += b_len) { if ((b_len = mbtowc(&wc, cp, MB_CUR_MAX)) <= 0) { (void) putchar(*cp); b_len = 1; @@ -124,7 +108,7 @@ main(int argc, char *argv[]) case '0': j = wd = 0; while ((*++cp >= '0' && *cp <= '7') && - j++ < 3) { + j++ < 3) { wd <<= 3; wd |= (*cp - '0'); } @@ -137,12 +121,9 @@ main(int argc, char *argv[]) (void) putchar(*cp); } } -#ifdef _iBCS2 - if (!(no_nl && i == argc)) -#endif /* _iBCS2 */ - (void) putchar(i == argc? '\n': ' '); - if (fflush(stdout) != 0) - return (1); + (void) putchar(i == argc? '\n': ' '); + if (fflush(stdout) != 0) + return (1); } return (0); } |
