This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch master in repository dpkg.
commit 453132199086db399401668a2c572b32c9f71717 Author: Guillem Jover <[email protected]> Date: Tue Feb 17 01:19:08 2015 +0100 Expand EOF and eof into "end of file" in error messages --- debian/changelog | 1 + dselect/methparse.cc | 15 ++++++++++----- lib/dpkg/parse.c | 16 ++++++---------- lib/dpkg/utils.c | 2 +- scripts/Dpkg/Changelog/Debian.pm | 7 ++++--- scripts/Dpkg/Control/HashCore.pm | 2 +- src/configure.c | 2 +- src/main.c | 3 ++- src/select.c | 6 ++++-- src/t/dpkg_divert.t | 6 ++++-- 10 files changed, 34 insertions(+), 26 deletions(-) diff --git a/debian/changelog b/debian/changelog index 99fef75..7b66375 100644 --- a/debian/changelog +++ b/debian/changelog @@ -85,6 +85,7 @@ dpkg (1.18.0) UNRELEASED; urgency=low - Say “execute” instead of “exec” in Dpkg::Changelog::Parse error message. - Say “package” instead of “it” in dpkg-name warning message. - Uppercase field names in error messages. + - Expand EOF and eof into “end of file” in error messages. [ Raphaël Hertzog ] * Drop myself from Uploaders. diff --git a/dselect/methparse.cc b/dselect/methparse.cc index ce38181..b1e5ab7 100644 --- a/dselect/methparse.cc +++ b/dselect/methparse.cc @@ -153,7 +153,8 @@ void readmethods(const char *pathbase, dselect_option **optionspp, int *nread) { badmethod(pathbuf, _("non-digit where digit wanted")); vb(c); c= fgetc(names); - if (c == EOF) eofmethod(pathbuf,names,_("EOF in index string")); + if (c == EOF) + eofmethod(pathbuf, names, _("end of file in index string")); } while (!c_isspace(c)); if (strlen(vb.string()) > OPTIONINDEXMAXLEN) badmethod(pathbuf,_("index string too long")); @@ -161,7 +162,8 @@ void readmethods(const char *pathbase, dselect_option **optionspp, int *nread) { do { if (c == '\n') badmethod(pathbuf,_("newline before option name start")); c= fgetc(names); - if (c == EOF) eofmethod(pathbuf,names,_("EOF before option name start")); + if (c == EOF) + eofmethod(pathbuf, names, _("end of file before option name start")); } while (c_isspace(c)); vb.reset(); if (!c_isalpha(c) && c != '_') @@ -171,20 +173,23 @@ void readmethods(const char *pathbase, dselect_option **optionspp, int *nread) { badmethod(pathbuf, _("non-alphanum in option name")); vb(c); c= fgetc(names); - if (c == EOF) eofmethod(pathbuf,names,_("EOF in option name")); + if (c == EOF) + eofmethod(pathbuf, names, _("end of file in option name")); } while (!c_isspace(c)); opt->name= new char[strlen(vb.string())+1]; strcpy(opt->name,vb.string()); do { if (c == '\n') badmethod(pathbuf,_("newline before summary")); c= fgetc(names); - if (c == EOF) eofmethod(pathbuf,names,_("EOF before summary")); + if (c == EOF) + eofmethod(pathbuf, names, _("end of file before summary")); } while (c_isspace(c)); vb.reset(); do { vb(c); c= fgetc(names); - if (c == EOF) eofmethod(pathbuf,names,_("EOF in summary - missing newline")); + if (c == EOF) + eofmethod(pathbuf, names, _("end of file in summary - missing newline")); } while (c != '\n'); opt->summary= new char[strlen(vb.string())+1]; strcpy(opt->summary,vb.string()); diff --git a/lib/dpkg/parse.c b/lib/dpkg/parse.c index a2847bd..4c3a294 100644 --- a/lib/dpkg/parse.c +++ b/lib/dpkg/parse.c @@ -636,14 +636,13 @@ parse_stanza(struct parsedb_state *ps, struct field_state *fs, /* Validate ‘:’. */ if (parse_EOF(ps)) - parse_error(ps, - _("EOF after field name `%.*s'"), fs->fieldlen, fs->fieldstart); + parse_error(ps, _("end of file after field name '%.*s'"), + fs->fieldlen, fs->fieldstart); if (c == '\n') parse_error(ps, _("newline in field name `%.*s'"), fs->fieldlen, fs->fieldstart); if (c == MSDOS_EOF_CHAR) - parse_error(ps, - _("MSDOS EOF (^Z) in field name `%.*s'"), + parse_error(ps, _("MSDOS end of file (^Z) in field name '%.*s'"), fs->fieldlen, fs->fieldstart); if (c != ':') parse_error(ps, @@ -657,12 +656,10 @@ parse_stanza(struct parsedb_state *ps, struct field_state *fs, break; } if (parse_EOF(ps)) - parse_error(ps, - _("EOF before value of field `%.*s' (missing final newline)"), + parse_error(ps, _("end of file before value of field '%.*s' (missing final newline)"), fs->fieldlen, fs->fieldstart); if (c == MSDOS_EOF_CHAR) - parse_error(ps, - _("MSDOS EOF char in value of field `%.*s' (missing newline?)"), + parse_error(ps, _("MSDOS end of file char in value of field '%.*s' (missing newline?)"), fs->fieldlen, fs->fieldstart); blank_line = false; @@ -692,8 +689,7 @@ parse_stanza(struct parsedb_state *ps, struct field_state *fs, } if (parse_EOF(ps)) - parse_error(ps, - _("EOF during value of field `%.*s' (missing final newline)"), + parse_error(ps, _("end of file during value of field '%.*s' (missing final newline)"), fs->fieldlen, fs->fieldstart); c = parse_getc(ps); diff --git a/lib/dpkg/utils.c b/lib/dpkg/utils.c index 1d0d687..dab74f5 100644 --- a/lib/dpkg/utils.c +++ b/lib/dpkg/utils.c @@ -49,7 +49,7 @@ fgets_must(char *buf, size_t bufsz, FILE *f, const char *fn) int l = fgets_checked(buf, bufsz, f, fn); if (l < 0) - ohshit(_("unexpected eof reading `%.250s'"), fn); + ohshit(_("unexpected end of file reading '%.250s'"), fn); return l; } diff --git a/scripts/Dpkg/Changelog/Debian.pm b/scripts/Dpkg/Changelog/Debian.pm index c25c69a..7ee5418 100644 --- a/scripts/Dpkg/Changelog/Debian.pm +++ b/scripts/Dpkg/Changelog/Debian.pm @@ -55,7 +55,7 @@ use parent qw(Dpkg::Changelog); use constant { FIRST_HEADING => g_('first heading'), - NEXT_OR_EOF => g_('next heading or eof'), + NEXT_OR_EOF => g_('next heading or end of file'), START_CHANGES => g_('start of change data'), CHANGES_OR_TRAILER => g_('more change data or trailer'), }; @@ -180,8 +180,9 @@ sub parse { } unless ($expect eq NEXT_OR_EOF) { - $self->parse_error($file, $., sprintf(g_('found eof where expected %s'), - $expect)); + $self->parse_error($file, $., + sprintf(g_('found end of file where expected %s'), + $expect)); } unless ($entry->is_empty) { push @{$self->{data}}, $entry; diff --git a/scripts/Dpkg/Control/HashCore.pm b/scripts/Dpkg/Control/HashCore.pm index 05aaa55..d558424 100644 --- a/scripts/Dpkg/Control/HashCore.pm +++ b/scripts/Dpkg/Control/HashCore.pm @@ -238,7 +238,7 @@ sub parse { $_ = <$fh> while defined && m/^\s*$/; unless (length) { $self->parse_error($desc, g_('expected OpenPGP signature, ' . - 'found EOF after blank line')); + 'found end of file after blank line')); } s/\s*\n$//; unless (m/^-----BEGIN PGP SIGNATURE-----$/) { diff --git a/src/configure.c b/src/configure.c index 304d405..cb75635 100644 --- a/src/configure.c +++ b/src/configure.c @@ -175,7 +175,7 @@ show_prompt(const char *cfgfile, const char *realold, const char *realnew, if (c == EOF) { if (ferror(stdin)) ohshite(_("read error on stdin at conffile prompt")); - ohshit(_("EOF on stdin at conffile prompt")); + ohshit(_("end of file on stdin at conffile prompt")); } if (!cc) { diff --git a/src/main.c b/src/main.c index 03e328f..4cb846a 100644 --- a/src/main.c +++ b/src/main.c @@ -813,7 +813,8 @@ commandfd(const char *const *argv) if (c_isspace(c)) argc++; } while (c != EOF && c != '\n'); - if (c == EOF) ohshit(_("unexpected eof before end of line %d"),lno); + if (c == EOF) + ohshit(_("unexpected end of file before end of line %d"), lno); if (!argc) continue; varbuf_end_str(&linevb); newargs = m_realloc(newargs, sizeof(const char *) * (argc + 1)); diff --git a/src/select.c b/src/select.c index a1eeb52..b0eafd4 100644 --- a/src/select.c +++ b/src/select.c @@ -148,14 +148,16 @@ setselections(const char *const *argv) while (!c_isspace(c)) { varbuf_add_char(&namevb, c); c= getchar(); - if (c == EOF) ohshit(_("unexpected eof in package name at line %d"),lno); + if (c == EOF) + ohshit(_("unexpected end of file in package name at line %d"), lno); if (c == '\n') ohshit(_("unexpected end of line in package name at line %d"),lno); } varbuf_end_str(&namevb); while (c != EOF && c_isspace(c)) { c= getchar(); - if (c == EOF) ohshit(_("unexpected eof after package name at line %d"),lno); + if (c == EOF) + ohshit(_("unexpected end of file after package name at line %d"), lno); if (c == '\n') ohshit(_("unexpected end of line after package name at line %d"),lno); } diff --git a/src/t/dpkg_divert.t b/src/t/dpkg_divert.t index 93265b3..b835766 100644 --- a/src/t/dpkg_divert.t +++ b/src/t/dpkg_divert.t @@ -564,7 +564,8 @@ install_diversions(<<'EOF'); EOF call_divert_sort(['--list'], expect_failure => 1, - expect_stderr_like => qr/(corrupt|unexpected eof)/, expect_stdout => ''); + expect_stderr_like => qr/(corrupt|unexpected end of file)/, + expect_stdout => ''); install_diversions(<<'EOF'); /bin/sh @@ -572,7 +573,8 @@ bash EOF call_divert_sort(['--list'], expect_failure => 1, - expect_stderr_like => qr/(corrupt|unexpected eof)/, expect_stdout => ''); + expect_stderr_like => qr/(corrupt|unexpected end of file)/, + expect_stdout => ''); cleanup(); -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/dpkg/dpkg.git -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected]

