summaryrefslogtreecommitdiff
path: root/usr/src/cmd/sh/print.c
diff options
context:
space:
mode:
authorna195498 <none@none>2006-06-21 18:29:08 -0700
committerna195498 <none@none>2006-06-21 18:29:08 -0700
commit39e7390a771e8a17884d4f1558a2a41422b38104 (patch)
treed5ea7b0238265aa99636dc30679e1d45c180b78e /usr/src/cmd/sh/print.c
parent4e78ab0b9d0501e5cbc9350082021bed9519ec06 (diff)
downloadillumos-joyent-39e7390a771e8a17884d4f1558a2a41422b38104.tar.gz
6306494 *sh* /bin/sh gettext()s things it shouldn't
6425519 /bin/sh doesn't respect LC_ALL
Diffstat (limited to 'usr/src/cmd/sh/print.c')
-rw-r--r--usr/src/cmd/sh/print.c65
1 files changed, 16 insertions, 49 deletions
diff --git a/usr/src/cmd/sh/print.c b/usr/src/cmd/sh/print.c
index 0bac00915b..ee10bb670a 100644
--- a/usr/src/cmd/sh/print.c
+++ b/usr/src/cmd/sh/print.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.
@@ -19,16 +18,16 @@
*
* CDDL HEADER END
*/
-/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
-
/*
- * Copyright (c) 1996, 1997 by Sun Microsystems, Inc.
- * All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
*/
-#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.12.6.1 */
+/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
+/* All Rights Reserved */
+
+#pragma ident "%Z%%M% %I% %E% SMI"
/*
* UNIX shell
*
@@ -70,10 +69,8 @@ prp()
void
prs(unsigned char *as)
{
- char *s;
-
- if ((s = gettext((char *)as)) != 0) {
- write(output, s, length(s) - 1);
+ if (as) {
+ write(output, as, length(as) - 1);
}
}
@@ -160,6 +157,7 @@ stoi(unsigned char *icp)
}
if (r < 0 || cp == icp) {
failed(icp, badnum);
+ /* NOTREACHED */
} else {
return (r);
}
@@ -180,16 +178,7 @@ ltos(long n)
return (i);
}
-void
-prl(long n)
-{
- int i;
- i = ltos(n);
- prs_buff(&numbuf[i]);
-}
-
-
-int
+static int
ulltos(u_longlong_t n)
{
int i;
@@ -206,14 +195,6 @@ ulltos(u_longlong_t n)
}
void
-prull(u_longlong_t n)
-{
- int i;
- i = ulltos(n);
- prs_buff(&numbuf[i]);
-}
-
-void
flushb()
{
if (index) {
@@ -241,21 +222,21 @@ prc_buff(unsigned char c)
void
prs_buff(unsigned char *s)
{
- int len = length(gettext((char *)s)) - 1;
+ int len = length(s) - 1;
if (buffd != -1 && index + len >= BUFLEN) {
flushb();
}
if (buffd != -1 && len >= BUFLEN) {
- write(buffd, gettext((char *)s), len);
+ write(buffd, s, len);
} else {
- movstr(gettext((char *)s), &bufp[index]);
+ movstr(s, &bufp[index]);
index += len;
}
}
-unsigned char *
+static unsigned char *
octal(unsigned char c, unsigned char *ptr)
{
*ptr++ = '\\';
@@ -326,12 +307,6 @@ prs_cntl(unsigned char *s)
}
void
-prl_buff(long lc)
-{
- prs_buff(&numbuf[ltos(lc)]);
-}
-
-void
prull_buff(u_longlong_t lc)
{
prs_buff(&numbuf[ulltos(lc)]);
@@ -345,14 +320,6 @@ prn_buff(int n)
prs_buff(numbuf);
}
-void
-prsp_buff(int cnt)
-{
- while (cnt--) {
- prc_buff(SPACE);
- }
-}
-
int
setb(int fd)
{