From 9803241aa8fe107d908bdfc3e225791e3fa41676 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 8 May 2018 01:18:11 +0200 Subject: Update basename according to clarfication in 2018 edition POSIX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- basename-test/test | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'basename-test') diff --git a/basename-test/test b/basename-test/test index 3e0d210..66c5b0a 100755 --- a/basename-test/test +++ b/basename-test/test @@ -2,7 +2,7 @@ cd -- "$(dirname "$0")" if test -z "$BASENAME"; then - BASENAME=../basename + BASENAME=../../basename fi b="$PREFIX $BASENAME" @@ -21,7 +21,13 @@ ddash () { test "$($b -- x)" = "x" report $? "ddash" - # http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02 + # http://pubs.opengroup.org/onlinepubs/9699919799/utilities/basename.html +} + +ddash_suf () +{ + test "$($b -- x.a a)" = "x." + report $? "ddash_suf" } lf () @@ -104,8 +110,8 @@ step_6_longer () if test $# = 0; then - set ddash lf step_1 step_2 step_3 step_4 step_5 step_4_5 step_6 step_6_4 \ - step_6_full step_6_mismatch step_6_longer + set ddash ddash_suf lf step_1 step_2 step_3 step_4 step_5 step_4_5 step_6 \ + step_6_4 step_6_full step_6_mismatch step_6_longer fi ( for f in $@; do -- cgit v1.2.3-70-g09d2