zsh-workers
 help / color / mirror / code / Atom feed
* Re: 3.1.6-pws-1: Cannot exit zsh if history file is unwritable
@ 1999-08-30 12:52 Sven Wischnowsky
  0 siblings, 0 replies; 2+ messages in thread
From: Sven Wischnowsky @ 1999-08-30 12:52 UTC (permalink / raw)
  To: zsh-workers


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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* 3.1.6-pws-1: Cannot exit zsh if history file is unwritable
@ 1999-08-30  8:27 Andrej Borsenkow
  0 siblings, 0 replies; 2+ messages in thread
From: Andrej Borsenkow @ 1999-08-30  8:27 UTC (permalink / raw)
  To: ZSH workers mailing list

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

/andrej


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-08-30 14:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-08-30 12:52 3.1.6-pws-1: Cannot exit zsh if history file is unwritable Sven Wischnowsky
  -- strict thread matches above, loose matches on Subject: below --
1999-08-30  8:27 Andrej Borsenkow

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).