huh, I thought I had extended ${parameter@#hash} already; make it so now,
but not yet things like ${parameter@Fi} (1 if integer, 0 otherwise), etc. also bump patchlevel and © years in recently changed files
This commit is contained in:
parent
c6b498d4fe
commit
21c15c0b8f
9
check.t
9
check.t
@ -1,4 +1,4 @@
|
||||
# $MirOS: src/bin/mksh/check.t,v 1.517 2012/03/20 16:48:12 tg Exp $
|
||||
# $MirOS: src/bin/mksh/check.t,v 1.518 2012/03/23 23:25:23 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 $
|
||||
@ -29,7 +29,7 @@
|
||||
# http://www.freebsd.org/cgi/cvsweb.cgi/src/tools/regression/bin/test/regress.sh?rev=HEAD
|
||||
|
||||
expected-stdout:
|
||||
@(#)MIRBSD KSH R40 2012/03/03
|
||||
@(#)MIRBSD KSH R40 2012/03/23
|
||||
description:
|
||||
Check version of shell.
|
||||
stdin:
|
||||
@ -7069,9 +7069,14 @@ stdin:
|
||||
typeset -i8 foo=10
|
||||
bar=baz
|
||||
unset baz
|
||||
bla=foo
|
||||
print ${foo@#} ${bar@#} ${baz@#} .
|
||||
print ${foo@#123} ${bar@#456} ${baz@#789} .
|
||||
print ${foo@#bla} ${bar@#bar} ${baz@#OPTIND} .
|
||||
expected-stdout:
|
||||
D50219A0 20E5DB5B 00000001 .
|
||||
554A1C76 004A212E CB209562 .
|
||||
6B21CF91 20E5DB5B 124EA49D .
|
||||
---
|
||||
name: varexpand-null-1
|
||||
description:
|
||||
|
5
edit.c
5
edit.c
@ -4,7 +4,8 @@
|
||||
/* $OpenBSD: vi.c,v 1.26 2009/06/29 22:50:19 martynas Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
|
||||
* Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
||||
* 2011, 2012
|
||||
* Thorsten Glaser <tg@mirbsd.org>
|
||||
*
|
||||
* Provided that these terms and disclaimer and all copyright notices
|
||||
@ -25,7 +26,7 @@
|
||||
|
||||
#include "sh.h"
|
||||
|
||||
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.229 2012/03/23 21:34:47 tg Exp $");
|
||||
__RCSID("$MirOS: src/bin/mksh/edit.c,v 1.230 2012/03/23 23:25:25 tg Exp $");
|
||||
|
||||
/*
|
||||
* in later versions we might use libtermcap for this, but since external
|
||||
|
26
eval.c
26
eval.c
@ -1,7 +1,8 @@
|
||||
/* $OpenBSD: eval.c,v 1.37 2011/10/11 14:32:43 otto Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
|
||||
* Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
||||
* 2011, 2012
|
||||
* Thorsten Glaser <tg@mirbsd.org>
|
||||
*
|
||||
* Provided that these terms and disclaimer and all copyright notices
|
||||
@ -22,7 +23,7 @@
|
||||
|
||||
#include "sh.h"
|
||||
|
||||
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.112 2012/03/23 20:07:10 tg Exp $");
|
||||
__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.113 2012/03/23 23:25:27 tg Exp $");
|
||||
|
||||
/*
|
||||
* string expansion
|
||||
@ -375,9 +376,26 @@ expand(const char *cp, /* input word */
|
||||
sp += slen;
|
||||
switch (stype & 0x17F) {
|
||||
case 0x100 | '#':
|
||||
x.str = shf_smprintf("%08X",
|
||||
(unsigned int)hash(str_val(st->var)));
|
||||
{
|
||||
char *beg, *end;
|
||||
mksh_ari_t seed;
|
||||
register uint32_t h;
|
||||
|
||||
beg = wdcopy(sp, ATEMP);
|
||||
end = beg + (wdscan(sp, CSUBST) - sp);
|
||||
end[-2] = EOS;
|
||||
end = wdstrip(beg, 0);
|
||||
afree(beg, ATEMP);
|
||||
evaluate(substitute(end, 0),
|
||||
&seed, KSH_UNWIND_ERROR, true);
|
||||
/* hash with seed, for now */
|
||||
h = seed;
|
||||
NZATUpdateString(h,
|
||||
str_val(st->var));
|
||||
NZATFinish(h);
|
||||
x.str = shf_smprintf("%08X", h);
|
||||
break;
|
||||
}
|
||||
case '0': {
|
||||
char *beg, *mid, *end, *stg;
|
||||
mksh_ari_t from = 0, num = -1, flen, finc = 0;
|
||||
|
15
mksh.1
15
mksh.1
@ -1,8 +1,8 @@
|
||||
.\" $MirOS: src/bin/mksh/mksh.1,v 1.281 2011/12/10 13:34:16 tg Exp $
|
||||
.\" $MirOS: src/bin/mksh/mksh.1,v 1.282 2012/03/23 23:25:27 tg Exp $
|
||||
.\" $OpenBSD: ksh.1,v 1.141 2011/09/03 22:59:08 jmc Exp $
|
||||
.\"-
|
||||
.\" Copyright © 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
|
||||
.\" 2010, 2011
|
||||
.\" 2010, 2011, 2012
|
||||
.\" Thorsten Glaser <tg@mirbsd.org>
|
||||
.\"
|
||||
.\" Provided that these terms and disclaimer and all copyright notices
|
||||
@ -72,7 +72,7 @@
|
||||
.\" with -mandoc, it might implement .Mx itself, but we want to
|
||||
.\" use our own definition. And .Dd must come *first*, always.
|
||||
.\"
|
||||
.Dd $Mdocdate: December 10 2011 $
|
||||
.Dd $Mdocdate: March 23 2012 $
|
||||
.\"
|
||||
.\" Check which macro package we use
|
||||
.\"
|
||||
@ -1614,9 +1614,14 @@ Currently,
|
||||
must start with a space, opening parenthesis or digit to be recognised.
|
||||
Cannot be applied to a vector.
|
||||
.Pp
|
||||
.It Pf ${ Ns Ar name Ns @#}
|
||||
.It Xo
|
||||
.Pf ${ Ar name
|
||||
.Pf @# Ns Oo Ar seed Oc Ns }
|
||||
.Xc
|
||||
The internal hash of the expansion of
|
||||
.Ar name .
|
||||
.Ar name ,
|
||||
with an optional (defaulting to zero)
|
||||
.Ar seed .
|
||||
At the moment, this is NZAT (a never-zero 32-bit hash based on
|
||||
Bob Jenkins' one-at-a-time hash), but this is not set.
|
||||
This is the hash the shell uses internally for its associative arrays.
|
||||
|
4
sh.h
4
sh.h
@ -152,9 +152,9 @@
|
||||
#endif
|
||||
|
||||
#ifdef EXTERN
|
||||
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.525 2012/03/23 21:58:22 tg Exp $");
|
||||
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.526 2012/03/23 23:25:29 tg Exp $");
|
||||
#endif
|
||||
#define MKSH_VERSION "R40 2012/03/03"
|
||||
#define MKSH_VERSION "R40 2012/03/23"
|
||||
|
||||
/* arithmetic types: C implementation */
|
||||
#if !HAVE_CAN_INTTYPES
|
||||
|
5
var.c
5
var.c
@ -1,7 +1,8 @@
|
||||
/* $OpenBSD: var.c,v 1.34 2007/10/15 02:16:35 deraadt Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
|
||||
* Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
|
||||
* 2011, 2012
|
||||
* Thorsten Glaser <tg@mirbsd.org>
|
||||
*
|
||||
* Provided that these terms and disclaimer and all copyright notices
|
||||
@ -26,7 +27,7 @@
|
||||
#include <sys/sysctl.h>
|
||||
#endif
|
||||
|
||||
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.142 2012/03/23 21:58:24 tg Exp $");
|
||||
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.143 2012/03/23 23:25:30 tg Exp $");
|
||||
|
||||
/*-
|
||||
* Variables
|
||||
|
Loading…
x
Reference in New Issue
Block a user