From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 28c459b8 for ; Tue, 29 Jan 2019 19:00:05 +0000 (UTC) Received: (qmail 2809 invoked by alias); 29 Jan 2019 18:59:47 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 44022 Received: (qmail 12370 invoked by uid 1010); 29 Jan 2019 18:59:47 -0000 X-Qmail-Scanner-Diagnostics: from joooj.vinc17.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.100.2/25112. spamassassin: 3.4.2. Clear:RC:0(155.133.131.76):SA:0(-1.9/5.0):. Processed in 1.621865 secs); 29 Jan 2019 18:59:47 -0000 X-Envelope-From: vincent@vinc17.net X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Date: Tue, 29 Jan 2019 19:51:24 +0100 From: Vincent Lefevre To: zsh-workers@zsh.org Subject: Regression in zsh 5.7: locking failed for /dev/null: permission denied Message-ID: <20190129185124.GA1618@zira.vinc17.org> Mail-Followup-To: zsh-workers@zsh.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/1.11.2+93 (3119b5a1) vl-114617 (2019-01-19) I use the following function, see suggestion from http://www.zsh.org/mla/workers/2016/msg02070.html append_file_to_hist() { emulate -LR zsh local -a entries # Implementation issue: read -r ignores backslash-newline # folding, but without -r embedded backslashes are stripped, # which seems a bigger problem. Fix up $entries later. IFS=$'\n' read -r -d '' -A entries <$1 (( $#entries )) || return # Must supply a file name here to set HISTSIZE and SAVEHIST fc -pa /dev/null $#entries $(( SAVEHIST + $#entries )) while (( $#entries )) do if [[ "$entries[1]" == *\\ ]] then entries[1,2]=( ${entries[1]%\\}$'\n'${entries[2]} ) else print -r -S $entries[1] shift 1 entries fi done fc -A ${2:-$HISTFILE} # Reset SAVEHIST to avoid attempting to lock /dev/null SAVEHIST=0 # fc -p makes this implicitly local } When I use it, I get the error: append_file_to_hist:24: locking failed for /dev/null: permission denied -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)