merge oksh’s “ctype cleanups” commit

(not much of it applies since we don’t use the OS’ table-based lookup)
This commit is contained in:
tg 2014-01-05 19:11:46 +00:00
parent 0545eb1c45
commit 2f7eec765d
6 changed files with 19 additions and 19 deletions

10
edit.c
View File

@ -1,7 +1,7 @@
/* $OpenBSD: edit.c,v 1.38 2013/06/03 15:41:59 tedu Exp $ */
/* $OpenBSD: edit.c,v 1.39 2013/12/17 16:37:05 deraadt Exp $ */
/* $OpenBSD: edit.h,v 1.9 2011/05/30 17:14:35 martynas Exp $ */
/* $OpenBSD: emacs.c,v 1.47 2013/11/28 10:33:37 sobrado Exp $ */
/* $OpenBSD: vi.c,v 1.26 2009/06/29 22:50:19 martynas Exp $ */
/* $OpenBSD: emacs.c,v 1.48 2013/12/17 16:37:05 deraadt Exp $ */
/* $OpenBSD: vi.c,v 1.28 2013/12/18 16:45:46 deraadt Exp $ */
/*-
* Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
@ -28,7 +28,7 @@
#ifndef MKSH_NO_CMDLINE_EDITING
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.273 2013/11/30 17:33:48 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.274 2014/01/05 19:11:43 tg Exp $");
/*
* in later versions we might use libtermcap for this, but since external
@ -3547,7 +3547,7 @@ x_vi(char *buf)
x_flush();
while (/* CONSTCOND */ 1) {
if (macro.p) {
c = *macro.p++;
c = (unsigned char)*macro.p++;
/* end of current macro? */
if (!c) {
/* more macros left to finish? */

4
expr.c
View File

@ -1,4 +1,4 @@
/* $OpenBSD: expr.c,v 1.22 2013/03/28 08:39:28 nicm Exp $ */
/* $OpenBSD: expr.c,v 1.23 2013/12/17 16:37:06 deraadt Exp $ */
/*-
* Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
@ -23,7 +23,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/expr.c,v 1.73 2013/11/30 23:20:03 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/expr.c,v 1.74 2014/01/05 19:11:44 tg Exp $");
/* the order of these enums is constrained by the order of opinfo[] */
enum token {

View File

@ -1,4 +1,4 @@
/* $OpenBSD: c_ksh.c,v 1.33 2009/02/07 14:03:24 kili Exp $ */
/* $OpenBSD: c_ksh.c,v 1.34 2013/12/17 16:37:05 deraadt Exp $ */
/* $OpenBSD: c_sh.c,v 1.44 2013/09/04 15:49:18 millert Exp $ */
/* $OpenBSD: c_test.c,v 1.18 2009/03/01 20:11:06 otto Exp $ */
/* $OpenBSD: c_ulimit.c,v 1.19 2013/11/28 10:33:37 sobrado Exp $ */
@ -38,7 +38,7 @@
#endif
#endif
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.252 2013/11/30 17:41:34 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.253 2014/01/05 19:11:44 tg Exp $");
#if HAVE_KILLPG
/*

4
lex.c
View File

@ -1,4 +1,4 @@
/* $OpenBSD: lex.c,v 1.48 2013/11/12 04:36:02 deraadt Exp $ */
/* $OpenBSD: lex.c,v 1.49 2013/12/17 16:37:06 deraadt Exp $ */
/*-
* Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
@ -23,7 +23,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.190 2013/11/17 22:19:42 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.191 2014/01/05 19:11:45 tg Exp $");
/*
* states while lexing word

4
main.c
View File

@ -1,6 +1,6 @@
/* $OpenBSD: main.c,v 1.54 2013/11/28 10:33:37 sobrado Exp $ */
/* $OpenBSD: tty.c,v 1.9 2006/03/14 22:08:01 deraadt Exp $ */
/* $OpenBSD: io.c,v 1.22 2006/03/17 16:30:13 millert Exp $ */
/* $OpenBSD: io.c,v 1.23 2013/12/17 16:37:06 deraadt Exp $ */
/* $OpenBSD: table.c,v 1.15 2012/02/19 07:52:30 otto Exp $ */
/*-
@ -34,7 +34,7 @@
#include <locale.h>
#endif
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.273 2013/11/30 17:33:50 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.274 2014/01/05 19:11:45 tg Exp $");
extern char **environ;

12
var.c
View File

@ -1,8 +1,8 @@
/* $OpenBSD: var.c,v 1.35 2013/04/05 01:31:30 tedu Exp $ */
/* $OpenBSD: var.c,v 1.36 2013/12/17 16:37:06 deraadt Exp $ */
/*-
* Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
* 2011, 2012, 2013
* 2011, 2012, 2013, 2014
* Thorsten Glaser <tg@mirbsd.org>
*
* Provided that these terms and disclaimer and all copyright notices
@ -27,7 +27,7 @@
#include <sys/sysctl.h>
#endif
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.173 2013/05/31 22:47:14 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.174 2014/01/05 19:11:46 tg Exp $");
/*-
* Variables
@ -228,7 +228,7 @@ global(const char *n)
/* Check to see if this is an array */
n = array_index_calc(n, &array, &val);
h = hash(n);
c = n[0];
c = (unsigned char)n[0];
if (!ksh_isalphx(c)) {
if (array)
errorf("bad substitution");
@ -239,7 +239,7 @@ global(const char *n)
*vp->name = c;
if (ksh_isdigit(c)) {
for (c = 0; ksh_isdigit(*n); n++)
c = c*10 + *n-'0';
c = (c * 10) + (*n - '0');
if (c <= l->argc)
/* setstr can't fail here */
setstr(vp, l->argv[c], KSH_RETURN_ERROR);
@ -500,7 +500,7 @@ getint(struct tbl *vp, mksh_ari_u *nump, bool arith)
base = 8;
have_base = true;
}
while ((c = *s++)) {
while ((c = (unsigned char)*s++)) {
if (c == '-') {
neg = true;
continue;