diff --git a/NEWS b/NEWS index de62d0613..edc25f26b 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,9 @@ Uppercase BUG_* IDs are shell bug IDs as used by the Modernish shell library. history expansion. (On 2022-01-24 the history comment character was set to '#' instead of being disabled by default, which exposed this bug.) +- Fixed a bug introduced on 2022-02-12 that would cause the optional head + builtin's -s option to fail. + 2022-08-08: - Release 1.0.2. diff --git a/src/cmd/ksh93/tests/b_head.sh b/src/cmd/ksh93/tests/b_head.sh new file mode 100644 index 000000000..f8eac9174 --- /dev/null +++ b/src/cmd/ksh93/tests/b_head.sh @@ -0,0 +1,92 @@ +######################################################################## +# # +# This software is part of the ast package # +# Copyright (c) 2019-2020 Contributors to ksh2020 # +# Copyright (c) 2022 Contributors to ksh 93u+m # +# and is licensed under the # +# Eclipse Public License, Version 2.0 # +# # +# A copy of the License is available at # +# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html # +# (with md5 checksum 84283fa8859daf213bdda5a9f8d1be1d) # +# # +# Kurtis Rader # +# Johnothan King # +# # +######################################################################## + +# Tests for `head` builtin + +. "${SHTESTS_COMMON:-${0%/*}/_common}" +if ! builtin head 2> /dev/null; then + warning 'Could not detect head builtin; skipping tests' + exit 0 +fi + +cat > "$tmp/file1" < "$tmp/file2" < * * Phong Vo * * Martijn Dekker * +* Johnothan King * * * ***********************************************************************/ #include "sfhdr.h" @@ -41,7 +42,6 @@ Sfoff_t sfmove(Sfio_t* fr, /* moving data from this stream */ ssize_t rsize = 0; if(!(fr)) return (Sfoff_t)0; - if(fw) for(n_move = 0; n != 0; ) {