If gpg.conf contains an invalid option on the last line, but there is no trailing newline, the wrong line number for this invalid option is reported.
Example:
echo -n "wrong_option" > ~/.gnupg/gpg.conf gpg --list-conf
Result:
gpg: gpg.conf:0:invalid option
Expected:
gpg: gpg.conf:1:invalid option
Possible fix: (not tested for side-effects)
--- a/common/argparse.c +++ b/common/argparse.c @@ -599,8 +599,7 @@ optfile_parse (FILE *fp, const char *filename, unsigned *lineno, c = getc (fp); if (c == '\n' || c== EOF ) { - if ( c != EOF ) - ++*lineno; + ++*lineno; if (state == -1) break; else if (state == 2)