Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2012-08-07 08:10:26 +0400
committerJunio C Hamano <gitster@pobox.com>2012-08-07 09:11:47 +0400
commit67ba123fd1fcb9a7699ae85f05f1229513322c1c (patch)
tree3c70f17eac81f82183b0419e8343b144a62eb851 /Makefile
parent21aeafceda2382d26bfa73a98ba45a937d65d77a (diff)
terminal: seek when switching between reading and writing
When a stdio stream is opened in update mode (e.g., "w+"), the C standard forbids switching between reading or writing without an intervening positioning function. Many implementations are lenient about this, but Solaris libc will flush the recently-read contents to the output buffer. In this instance, that meant writing the non-echoed password that the user just typed to the terminal. Fix it by inserting a no-op fseek between the read and write. The opposite direction (writing followed by reading) is also disallowed, but our intervening fflush is an acceptable positioning function for that alternative. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Makefile')
0 files changed, 0 insertions, 0 deletions