parser.c: shrink the input buffer when appropriate

Merge request reports