Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/bin/sh Complete the special request by quoting chapter...



details:   https://anonhg.NetBSD.org/src/rev/d76f48a0bb3c
branches:  trunk
changeset: 824377:d76f48a0bb3c
user:      kre <kre%NetBSD.org@localhost>
date:      Sat Jun 03 14:45:59 2017 +0000

description:
Complete the special request by quoting chapter & verse from POSIX
as to why ${011} is ${11} and not ${9} (that is, why we interpret it
that way, the "why could it not be the other way?" is just "because
that is not how it was ever implemented".

diffstat:

 tests/bin/sh/t_expand.sh |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (21 lines):

diff -r 2adb123a192b -r d76f48a0bb3c tests/bin/sh/t_expand.sh
--- a/tests/bin/sh/t_expand.sh  Sat Jun 03 14:44:12 2017 +0000
+++ b/tests/bin/sh/t_expand.sh  Sat Jun 03 14:45:59 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_expand.sh,v 1.16 2017/06/03 11:23:01 kre Exp $
+# $NetBSD: t_expand.sh,v 1.17 2017/06/03 14:45:59 kre Exp $
 #
 # Copyright (c) 2007, 2009 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -424,6 +424,11 @@
                        '0=a 1=b 2=c' 0
 
        # by special request, for PaulG...  (${0...} is not octal!)
+
+       # Posix XCU 2.5.1 (Issue 7 TC2 pg 2349 lines 74835..6):
+       #   The digits denoting the positional parameters shall always
+       #   be interpreted as a decimal value, even if there is a leading zero.
+
        check \
            'set -- a b c d e f g h i j k l m; echo "$#: ${08} ${010} ${011}"' \
                '13: h j k' 0



Home | Main Index | Thread Index | Old Index