Path: utzoo!utgpu!watmath!clyde!ima!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.bugs.4bsd Subject: Re: ungetc will put characters back into an _IOSTRG input stream Summary: Could change _doscan instead of ungetc Keywords: writable strings, shared strings (text segment), sscanf, ungetc Message-ID: <11821@haddock.ima.isc.com> Date: 21 Feb 89 20:53:04 GMT References: <20282@lll-winken.LLNL.GOV> <7898@boring.cwi.nl> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Boston Lines: 6 The solutions I've seen all involve changing ungetc(). It would also be possible to change the scanf() internals to just decrement _ptr instead of calling ungetc(); I believe that, in the usual stdio implementation, this would do the right thing for both string files and real files. Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint