From 4625e0eabc91d3e49404a6463e9ed8b2548b05b9 Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Tue, 18 Mar 2008 15:14:20 +0000 Subject: 24717, 24718, 24719: a 0 subscript is neither valid nor equivalent to 1 any longer, so the (i) subscript flag on an empty array needs to yield 1. --- Test/D06subscript.ztst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Test/D06subscript.ztst') diff --git a/Test/D06subscript.ztst b/Test/D06subscript.ztst index 6c9f477cc..4cb814977 100644 --- a/Test/D06subscript.ztst +++ b/Test/D06subscript.ztst @@ -178,11 +178,15 @@ >lower >upper - typeset -a empty_array - echo X${${l##*}[-1]}X + typeset -ga empty + echo X${${empty##*}[-1]}X 0:Negative index applied to substition result from empty array >XX + print $empty[(i)] $empty[(I)] +0:(i) returns 1 for empty array, (I) returns 0. +>1 0 + array=(one two three four) print X$array[0]X 0:Element zero is empty if KSH_ZERO_SUBSCRIPT is off. -- cgit 1.4.1