glcpp: Make standalone preprocessor work with a tty as stdin
authorCarl Worth <cworth@cworth.org>
Mon, 23 Aug 2010 17:43:27 +0000 (10:43 -0700)
committerCarl Worth <cworth@cworth.org>
Mon, 23 Aug 2010 17:48:10 +0000 (10:48 -0700)
commit61f73fec532b24ef5ec4b5baef81f5e6b9f20918
tree4afb5c938b17bfb2f02d34ac48ebfde122de8640
parent21560c40e8aa98624a225752b98babc7ae2938d5
glcpp: Make standalone preprocessor work with a tty as stdin

Previously glcpp would silently abort if it couldn't fstat the file being
read, (so it would work with stdin redirected from a file, but would not
work with stdin as a tty). The stat was so that glcpp could allocate
a buffer for the file content in a single call.

We now use talloc_realloc instead, (even if the fstat is
possible). This is theoretically less efficient, but quite irrelevant,
(particularly because the standalone preprocessor is used only for
testing).
src/glsl/glcpp/glcpp.c