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:
7
var.c
7
var.c
@@ -1,8 +1,8 @@
|
||||
/* $OpenBSD: var.c,v 1.28 2005/12/11 20:31:21 otto Exp $ */
|
||||
/* $OpenBSD: var.c,v 1.29 2006/03/13 08:21:37 otto Exp $ */
|
||||
|
||||
#include "sh.h"
|
||||
|
||||
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.16 2006/01/30 12:37:24 tg Exp $");
|
||||
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.17 2006/05/10 18:54:13 tg Exp $");
|
||||
|
||||
/*
|
||||
* Variables
|
||||
@@ -418,6 +418,9 @@ getint(struct tbl *vp, long int *nump, bool arith)
|
||||
if (*s == 'x' || *s == 'X') {
|
||||
s++;
|
||||
base = 16;
|
||||
} else if (vp->flag & ZEROFIL) {
|
||||
while (*s == '0')
|
||||
s++;
|
||||
} else
|
||||
base = 8;
|
||||
have_base++;
|
||||
|
Reference in New Issue
Block a user