Skip to content
  • Josh Triplett's avatar
    watch: Don't attempt to ungetc parts of unknown ANSI escape sequences · 0236d278
    Josh Triplett authored
    
    
    If process_ansi encountered an unknown character when processing an ANSI
    escape sequence, it would ungetc all the characters read so far, except
    for the character just read, and the opening '\033['.  ungetting the
    middle of the escape sequence does not produce useful results, and also
    relies on the unportable assumption that ungetc works on multiple
    characters (which glibc does not support).  Discard the characters
    instead.
    
    Signed-off-by: default avatarJosh Triplett <josh@joshtriplett.org>
    0236d278