From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29908 invoked from network); 30 Aug 1999 14:26:54 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 30 Aug 1999 14:26:54 -0000 Received: (qmail 6853 invoked by alias); 30 Aug 1999 14:26:39 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7549 Received: (qmail 6818 invoked from network); 30 Aug 1999 14:26:39 -0000 Date: Mon, 30 Aug 1999 14:52:19 +0200 (MET DST) Message-Id: <199908301252.OAA21744@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Andrej Borsenkow"'s message of Mon, 30 Aug 1999 12:27:06 +0400 Subject: Re: 3.1.6-pws-1: Cannot exit zsh if history file is unwritable Andrej Borsenkow wrote: > bor@itsrm2:~%> sudo -u nerv -s > nerv@itsrm2:~%> cd > zsh: can't write history file /home/bor/.zsh_history > nerv@itsrm2:~%> exit > zsh: can't write history file /home/bor/.zsh_history > > It is no more possible to execute any single command. > > nerv@itsrm2:~%> logout > zsh: can't write history file /home/bor/.zsh_history > nerv@itsrm2:~%> tty > zsh: can't write history file /home/bor/.zsh_history This is the simplest fix. Note that this means that you don't get the warning message on each command any more, but you get it when exiting the shell (but you *can* exit it). Maybe this different second argument (named `err' and indicating that errors should be raised in `savehistfile()') was even intended to be zero in that call -- otherwise it would be `1' in all calls, which seems strange. Bye Sven --- os/hist.c Mon Aug 30 11:57:55 1999 +++ Src/hist.c Mon Aug 30 14:45:47 1999 @@ -1043,7 +1043,7 @@ chline = NULL; histactive = 0; if (isset(SHAREHISTORY) || isset(INCAPPENDHISTORY)) - savehistfile(hf, 1, HFILE_USE_OPTIONS | HFILE_FAST); + savehistfile(hf, 0, HFILE_USE_OPTIONS | HFILE_FAST); unlockhistfile(hf); /* It's OK to call this even if we aren't locked */ return !(flag & HISTFLAG_NOEXEC || errflag); } -- Sven Wischnowsky wischnow@informatik.hu-berlin.de