summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorChristian Weisgerber <naddy@cvs.openbsd.org>2015-10-26 16:27:05 +0000
committerChristian Weisgerber <naddy@cvs.openbsd.org>2015-10-26 16:27:05 +0000
commit618425776f3c2632152e75dd19885a1bc55371c8 (patch)
tree0cf38c55ebf005044fe6d4643779538e906e7e88 /bin
parentdb0279f8ac9ff5cba34335bb38abc89dab01c9d1 (diff)
Clean up cruft made visible by the NLS unifdefing:
* remove setlocale() calls * remove write-only variable AsciiOnly * remove now unused string constants STRLANG, STRLC_CTYPE * remove hardcoded support for ISO8859-1 ok millert@
Diffstat (limited to 'bin')
-rw-r--r--bin/csh/char.c101
-rw-r--r--bin/csh/const.c4
-rw-r--r--bin/csh/csh.c18
-rw-r--r--bin/csh/csh.h4
-rw-r--r--bin/csh/func.c18
-rw-r--r--bin/csh/str.c6
6 files changed, 9 insertions, 142 deletions
diff --git a/bin/csh/char.c b/bin/csh/char.c
index 0972214ad0e..d90a6ce51f3 100644
--- a/bin/csh/char.c
+++ b/bin/csh/char.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: char.c,v 1.5 2015/10/26 15:01:15 naddy Exp $ */
+/* $OpenBSD: char.c,v 1.6 2015/10/26 16:27:04 naddy Exp $ */
/* $NetBSD: char.c,v 1.6 1995/03/21 09:02:26 cgd Exp $ */
/*-
@@ -130,101 +130,8 @@ unsigned short _cmap[256] = {
_META|_CMD, 0, 0, _CTR,
/****************************************************************/
-/* 128 - 255 The below is supposedly ISO 8859/1 */
+/* 128 - 255 */
/****************************************************************/
-/* (undef) (undef) (undef) (undef) */
- _CTR, _CTR, _CTR, _CTR,
-
-/* (undef) (undef) (undef) (undef) */
- _CTR, _CTR, _CTR, _CTR,
-
-/* (undef) (undef) (undef) (undef) */
- _CTR, _CTR, _CTR, _CTR,
-
-/* (undef) (undef) (undef) (undef) */
- _CTR, _CTR, _CTR, _CTR,
-
-/* (undef) (undef) (undef) (undef) */
- _CTR, _CTR, _CTR, _CTR,
-
-/* (undef) (undef) (undef) (undef) */
- _CTR, _CTR, _CTR, _CTR,
-
-/* (undef) (undef) (undef) (undef) */
- _CTR, _CTR, _CTR, _CTR,
-
-/* (undef) (undef) (undef) (undef) */
- _CTR, _CTR, _CTR, _CTR,
-
-/* nobreakspace exclamdown cent sterling */
- _SP, 0, 0, 0,
-
-/* currency yen brokenbar section */
- 0, 0, 0, 0,
-
-/* diaeresis copyright ordfeminine guillemotleft */
- 0, 0, 0, 0,
-
-/* notsign hyphen registered macron */
- 0, 0, 0, 0,
-
-/* degree plusminus twosuperior threesuperior */
- 0, 0, 0, 0,
-
-/* acute mu paragraph periodcentered */
- 0, 0, 0, 0,
-
-/* cedilla onesuperior masculine guillemotright */
- 0, 0, 0, 0,
-
-/* onequarter onehalf threequarters questiondown */
- 0, 0, 0, 0,
-
-/* Agrave Aacute Acircumflex Atilde */
- _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
-
-/* Adiaeresis Aring AE Ccedilla */
- _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
-
-/* Egrave Eacute Ecircumflex Ediaeresis */
- _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
-
-/* Igrave Iacute Icircumflex Idiaeresis */
- _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
-
-/* ETH Ntilde Ograve Oacute */
- _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
-
-/* Ocircumflex Otilde Odiaeresis multiply */
- _LET|_UP, _LET|_UP, _LET|_UP, 0,
-
-/* Ooblique Ugrave Uacute Ucircumflex */
- _LET|_UP, _LET|_UP, _LET|_UP, _LET|_UP,
-
-/* Udiaeresis Yacute THORN ssharp */
- _LET|_UP, _LET|_UP, _LET|_UP, _LET|_LOW,
-
-/* agrave aacute acircumflex atilde */
- _LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW,
-
-/* adiaeresis aring ae ccedilla */
- _LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW,
-
-/* egrave eacute ecircumflex ediaeresis */
- _LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW,
-
-/* igrave iacute icircumflex idiaeresis */
- _LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW,
-
-/* eth ntilde ograve oacute */
- _LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW,
-
-/* ocircumflex otilde odiaeresis division */
- _LET|_LOW, _LET|_LOW, _LET|_LOW, 0,
-
-/* oslash ugrave uacute ucircumflex */
- _LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW,
-
-/* udiaeresis yacute thorn ydiaeresis */
- _LET|_LOW, _LET|_LOW, _LET|_LOW, _LET|_LOW,
+/* (undef) ... */
+ 0,
};
diff --git a/bin/csh/const.c b/bin/csh/const.c
index 0038d1cb641..9307f2d370d 100644
--- a/bin/csh/const.c
+++ b/bin/csh/const.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: const.c,v 1.7 2015/06/17 03:48:21 deraadt Exp $ */
+/* $OpenBSD: const.c,v 1.8 2015/10/26 16:27:04 naddy Exp $ */
/* $NetBSD: const.c,v 1.6 1995/03/21 09:02:31 cgd Exp $ */
/*-
@@ -39,8 +39,6 @@
Char STR0[] = { '0', '\0' };
Char STR1[] = { '1', '\0' };
Char STRHOME[] = { 'H', 'O', 'M', 'E', '\0' };
-Char STRLANG[] = { 'L', 'A', 'N', 'G', '\0' };
-Char STRLC_CTYPE[] = { 'L', 'C', '_', 'C', 'T', 'Y', 'P', 'E' ,'\0' };
Char STRLOGNAME[] = { 'L', 'O', 'G', 'N', 'A', 'M', 'E', '\0' };
Char STRLbrace[] = { '{', '\0' };
Char STRLparen[] = { '(', '\0' };
diff --git a/bin/csh/csh.c b/bin/csh/csh.c
index e04983c699e..e6852ed4032 100644
--- a/bin/csh/csh.c
+++ b/bin/csh/csh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: csh.c,v 1.31 2015/10/26 15:01:15 naddy Exp $ */
+/* $OpenBSD: csh.c,v 1.32 2015/10/26 16:27:04 naddy Exp $ */
/* $NetBSD: csh.c,v 1.14 1995/04/29 23:21:28 mycroft Exp $ */
/*-
@@ -155,22 +155,10 @@ main(int argc, char *argv[])
if (loginsh)
(void) time(&chktim);
- AsciiOnly = 1;
-
- (void) setlocale(LC_ALL, "");
-
if (pledge("stdio rpath wpath cpath fattr getpw proc exec tty",
NULL) == -1)
perror("pledge");
- {
- int k;
-
- for (k = 0200; k <= 0377 && !Isprint(k); k++)
- continue;
- AsciiOnly = k > 0377;
- }
-
/*
* Move the descriptors to safe places. The variable didfds is 0 while we
* have only FSH* to work with. When didfds is true, we have 0,1,2 and
@@ -1247,10 +1235,6 @@ vis_fputc(int ch, FILE *fp)
if (ch & QUOTE)
return fputc(ch & TRIM, fp);
- /*
- * XXX: When we are in AsciiOnly we want all characters >= 0200 to
- * be encoded, but currently there is no way in vis to do that.
- */
(void) vis(uenc, ch & TRIM, VIS_NOSLASH, 0);
return fputs(uenc, fp);
}
diff --git a/bin/csh/csh.h b/bin/csh/csh.h
index ff9bb8fb69c..d111dced5b6 100644
--- a/bin/csh/csh.h
+++ b/bin/csh/csh.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: csh.h,v 1.23 2015/10/26 15:01:15 naddy Exp $ */
+/* $OpenBSD: csh.h,v 1.24 2015/10/26 16:27:04 naddy Exp $ */
/* $NetBSD: csh.h,v 1.9 1995/03/21 09:02:40 cgd Exp $ */
/*-
@@ -193,8 +193,6 @@ sig_t parterm; /* Parents terminate catch */
#define QUOTE 0100000U /* 16nth char bit used for 'ing */
#define TRIM 0077777 /* Mask to strip quote bit */
-int AsciiOnly; /* If set only 7 bits is expected in characters */
-
/*
* Each level of input has a buffered input structure.
* There are one or more blocks of buffered input for each level,
diff --git a/bin/csh/func.c b/bin/csh/func.c
index fb3c41f1e62..376eed964da 100644
--- a/bin/csh/func.c
+++ b/bin/csh/func.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: func.c,v 1.30 2015/10/26 15:01:15 naddy Exp $ */
+/* $OpenBSD: func.c,v 1.31 2015/10/26 16:27:04 naddy Exp $ */
/* $NetBSD: func.c,v 1.11 1996/02/09 02:28:29 christos Exp $ */
/*-
@@ -917,14 +917,6 @@ dosetenv(Char **v, struct command *t)
importpath(lp);
dohash(NULL, NULL);
}
- else if (eq(vp, STRLANG) || eq(vp, STRLC_CTYPE)) {
- int k;
-
- (void) setlocale(LC_ALL, "");
- for (k = 0200; k <= 0377 && !Isprint(k); k++)
- continue;
- AsciiOnly = k > 0377;
- }
xfree(lp);
}
@@ -959,14 +951,6 @@ dounsetenv(Char **v, struct command *t)
if (!Gmatch(name, *v))
continue;
maxi = 1;
- if (eq(name, STRLANG) || eq(name, STRLC_CTYPE)) {
- int k;
-
- (void) setlocale(LC_ALL, "");
- for (k = 0200; k <= 0377 && !Isprint(k); k++)
- continue;
- AsciiOnly = k > 0377;
- }
/*
* Delete name, and start again cause the environment changes
*/
diff --git a/bin/csh/str.c b/bin/csh/str.c
index 77d0cd37eef..85c41c32c46 100644
--- a/bin/csh/str.c
+++ b/bin/csh/str.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: str.c,v 1.17 2015/10/26 15:01:15 naddy Exp $ */
+/* $OpenBSD: str.c,v 1.18 2015/10/26 16:27:04 naddy Exp $ */
/* $NetBSD: str.c,v 1.6 1995/03/21 09:03:24 cgd Exp $ */
/*-
@@ -399,10 +399,6 @@ vis_str(Char *cp)
sdst = xreallocarray(sdst, n, sizeof(char));
dstsize = n;
}
- /*
- * XXX: When we are in AsciiOnly we want all characters >= 0200 to
- * be encoded, but currently there is no way in vis to do that.
- */
(void) strnvis(sdst, short2str(cp), dstsize, VIS_NOSLASH);
return (sdst);
}