Thread (3 messages) flat view 3 messages, 2 authors, 2016-06-15

Re: [PATCH] config: do not ungetc EOF

From: Heiko Voigt <hidden>
Date: 2016-06-15 23:03:46

On Thu, Feb 05, 2015 at 04:00:24PM -0500, Jeff King wrote:
On Thu, Feb 05, 2015 at 01:53:27AM -0500, Jeff King wrote:
quoted
I also notice that config_buf_ungetc does not actually ungetc the
character we give it; it just rewinds one character in the stream. This
is fine, because we always feed the last-retrieved character. I dunno if
it is worth fixing (it also would have fixed this infinite loop, but for
the wrong reason; we would have stuck "-1" back into the stream, and
retrieved it on the next fgetc rather than the same '\r' over and over).
Here's a patch to deal with that. I'm not sure if it's worth doing or
not.

-- >8 --
Subject: [PATCH] config_buf_ungetc: warn when pushing back a random character
Thanks for noticing and fixing both. I think it is worth adding this
assertion. If someone in the future comes along and uses our fake
ungetc() wrong it might save some trouble figuring out whats wrong.

Cheers Heiko
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help