revert the return type of x_e_getc() back from u_char to int

this change broke abortion on failure to read input, was not
needed for gcc warnings and is the fault of Intel’s compiler

this should fix the other busy-loop problem occuring only on
GNU/Linux so far – 10x spaetzle@freewrt.o for pointing me to
the problem; reproduced on my work craptop
This commit is contained in:
tg 2007-10-09 14:50:50 +00:00
parent eab0a407eb
commit 52b9911ff6
3 changed files with 7 additions and 7 deletions

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.138 2007/09/09 18:06:38 tg Exp $
# $MirOS: src/bin/mksh/check.t,v 1.139 2007/10/09 14:50:49 tg Exp $
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
@ -7,7 +7,7 @@
# http://www.research.att.com/~gsf/public/ifs.sh
expected-stdout:
@(#)MIRBSD KSH R31 2007/09/09
@(#)MIRBSD KSH R31 2007/10/09
description:
Check version of shell.
category: pdksh

6
edit.c
View File

@ -5,7 +5,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.113 2007/09/09 20:03:32 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.114 2007/10/09 14:50:50 tg Exp $");
/* tty driver characters we are interested in */
typedef struct {
@ -1136,7 +1136,7 @@ static void x_mapout2(int, char **);
static void x_print(int, int);
static void x_adjust(void);
static void x_e_ungetc(int);
static u_char x_e_getc(void);
static int x_e_getc(void);
static void x_e_putc2(int);
static void x_e_putc3(const char **);
static void x_e_puts(const char *);
@ -2917,7 +2917,7 @@ x_e_ungetc(int c)
unget_char = c;
}
static u_char
static int
x_e_getc(void)
{
int c;

4
sh.h
View File

@ -8,8 +8,8 @@
/* $OpenBSD: c_test.h,v 1.4 2004/12/20 11:34:26 otto Exp $ */
/* $OpenBSD: tty.h,v 1.5 2004/12/20 11:34:26 otto Exp $ */
#define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.175 2007/09/09 18:06:41 tg Exp $"
#define MKSH_VERSION "R31 2007/09/09"
#define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.176 2007/10/09 14:50:50 tg Exp $"
#define MKSH_VERSION "R31 2007/10/09"
#if HAVE_SYS_PARAM_H
#include <sys/param.h>