awk: maketab: sscanf short matches should not cause extra printname[] entries
commit46a21902afa178799bdd5f38aa6f8adca53edd13
authorLauri Tirkkonen <lotheac@iki.fi>
Mon, 29 Jan 2018 12:31:08 +0000 (29 14:31 +0200)
committerLauri Tirkkonen <lotheac@iki.fi>
Mon, 29 Jan 2018 12:52:34 +0000 (29 14:52 +0200)
treebabf130a95435ad97787f708541ff108bbef3135
parent714d5f7b71ce5372ee528764d5d1a437787124ef
awk: maketab: sscanf short matches should not cause extra printname[] entries

the sscanf must match all elements: if no digit is provided at the end
of the line, we will end up reusing the previous digit. consider:
    #define LASTTOKEN 349
    #define YYSTYPE_DEFINED
which results in
    (char *) "LASTTOKEN",    /* 349 */
    (char *) "YYSTYPE_DEFINED",    /* 349 */
unless the latter #define is considered invalid (*either* sscanf returns
!= 4, or the second token doesn't equal "define", not both)
contrib/awk/maketab.c