From 4e18d65894db01ba7851b83ea5d75f98e59177b2 Mon Sep 17 00:00:00 2001 From: Johnothan King Date: Tue, 16 Aug 2022 14:44:26 -0700 Subject: [PATCH] Fix regression in handling of head builtin's -s flag (re: 4ca578bd) (#514) Commit 4ca578bd accidentally left in half of an if statement that was originally just a use of the SFMTXBEGIN2 macro (which is a no-op without vt_threaded). As a result, the head builtin's -s flag broke in one of the ksh2020 regression tests. Reproducer: # Note that head must be enabled in src/cmd/ksh93/data/builtins.c builtin head || exit 1 cat > "/tmp/file1" < # +# 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; ) {