zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: RMSTARSILENT
@ 2000-02-28 13:08 Sven Wischnowsky
  2000-02-28 19:12 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Sven Wischnowsky @ 2000-02-28 13:08 UTC (permalink / raw)
  To: zsh-workers


... or, more precisely, getquery() and noquery().

Doing `rm *' didn't work for me any more because getquery() always
retunred immediatly with `n'. Although this makes `rm *' really save,
I think it shouldn't do that. The problem was in noquery():

  int
  noquery(int purge)
  {
      int c, val = 0;

  #ifdef FIONREAD
      ioctl(SHTTY, FIONREAD, (char *)&val);
      if (purge) {
	  while(val--)
	      read(SHTTY, &c, 1);
      }
  #endif

      return val;
  }

So, with FIONREAD and purge!=0, we always returned -1. That was wrong, 
wasn't it?

Bye
 Sven

diff -ru ../z.old/Src/utils.c Src/utils.c
--- ../z.old/Src/utils.c	Mon Feb 28 12:58:36 2000
+++ Src/utils.c	Mon Feb 28 14:02:26 2000
@@ -1318,7 +1318,7 @@
 #ifdef FIONREAD
     ioctl(SHTTY, FIONREAD, (char *)&val);
     if (purge) {
-	while(val--)
+	for (; val; val--)
 	    read(SHTTY, &c, 1);
     }
 #endif

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


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

end of thread, other threads:[~2000-02-28 19:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-02-28 13:08 PATCH: RMSTARSILENT Sven Wischnowsky
2000-02-28 19:12 ` Bart Schaefer

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