apply some fixes from OpenBSD and don't apply some others

but sync RCS IDs for easier future adaption:
* Simplify savefd() by removing the "noclose" flag and make noclose
  behavior the default. Almost all uses of savefd() are followed
  by an implicit or explicit close.
* fix typos
* might as well make ksh_getopt() match real getopt(), ie. get rid of that
  stupid EOF concept that was never true. adobriyan@gmail
* use SEEK_* for lseek()
* fix lint comments, no functional changes
* remove excessive optimization; from adobriyan@gmail
* only santa checks things twice; from adobriyan@gmail
* Interpret zero-filled numbers as decimal; PR 4213; from Alexey Dobriyan
This commit is contained in:
tg
2006-05-10 18:54:13 +00:00
parent 301066165b
commit 7672b9b346
16 changed files with 96 additions and 93 deletions

8
expr.c
View File

@ -1,8 +1,8 @@
/* $OpenBSD: expr.c,v 1.18 2005/03/30 17:16:37 deraadt Exp $ */
/* $OpenBSD: expr.c,v 1.19 2006/04/10 14:38:59 jaredy Exp $ */
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/expr.c,v 1.3 2005/11/22 18:40:42 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/expr.c,v 1.4 2006/05/10 18:54:10 tg Exp $");
/* The order of these enums is constrained by the order of opinfo[] */
enum token {
@ -182,7 +182,7 @@ v_evaluate(struct tbl *vp, const char *expr, volatile int error_ok,
errorf(null);
}
unwind(i);
/*NOTREACHED*/
/* NOTREACHED */
}
token(es);
@ -298,7 +298,7 @@ evalexpr(Expr_state *es, enum prec prec)
token(es);
} else {
evalerr(es, ET_UNEXPECTED, NULL);
/*NOTREACHED*/
/* NOTREACHED */
}
if (es->tok == O_PLUSPLUS || es->tok == O_MINUSMINUS) {
vl = do_ppmm(es, es->tok, vl, false);