handle nuls more carefully in re2c rules
authorEvan Martin <martine@danga.com>
Thu, 29 Dec 2011 20:44:15 +0000 (12:44 -0800)
committerEvan Martin <martine@danga.com>
Thu, 29 Dec 2011 20:44:15 +0000 (12:44 -0800)
commit47ba90bd530cfd269f40e61e5d41e87298812ddb
tree036c43c3d07eab02b49ca593eca4e54b5a9a8727
parenteaf1ff190423b1cf41eb1b905192be07aeb6b22e
handle nuls more carefully in re2c rules

- '.' in re2c matches anything except \n, which means it matches \000.
  Be more careful about which characters we match.
- The fallback rule [^] reads ahead another character, which means it
  can read past the trailing \000.  Add a separate rule to match it
  specifically.

This was found by Valgrind.
src/depfile_parser.cc
src/depfile_parser.in.cc