delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/04/30/07:17:27

Date: Tue, 30 Apr 1996 15:08:35 +0400 (MSD)
From: "Alexander V. Lukyanov" <lav AT video DOT yars DOT free DOT net>
Message-Id: <199604301108.PAA05012@video.yars.free.net>
To: djgpp-workers AT delorie DOT com
Subject: small change in ungetc

--- ungetc.c.orig	Fri Mar 22 15:47:08 1996
+++ ungetc.c	Fri Apr 12 21:24:38 1996
@@ -20,8 +20,12 @@
   }
 
   f->_cnt++;
-  *--f->_ptr = c;
-  f->_flag |= _IOUNGETC;
+  f->_ptr--;
+  if(*f->_ptr != c)
+  {
+    f->_flag |= _IOUNGETC;
+    *f->_ptr = c;
+  }
 
   return c;
 }

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019