From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: 3.1.6-pws-1: Cannot exit zsh if history file is unwritable
Date: Mon, 30 Aug 1999 14:52:19 +0200 (MET DST) [thread overview]
Message-ID: <199908301252.OAA21744@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Andrej Borsenkow"'s message of Mon, 30 Aug 1999 12:27:06 +0400
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
next reply other threads:[~1999-08-30 14:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-08-30 12:52 Sven Wischnowsky [this message]
-- strict thread matches above, loose matches on Subject: below --
1999-08-30 8:27 Andrej Borsenkow
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199908301252.OAA21744@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).