This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch master
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=2cb4c03e6cbabf8880bc226c4b35a870fc206ec4

commit 2cb4c03e6cbabf8880bc226c4b35a870fc206ec4
Author: Guillem Jover <[email protected]>
AuthorDate: Sun May 31 13:30:37 2020 +0200

    libdpkg: Fix error message for invalid version ending in dependency parser
    
    The error messages where printing a character not matching the actual
    one found, which can be rather confusing. Merge the two identical cases
    by parametrizing the character to print, and print out also what is
    expected to help the user.
    
    Fixes: commit 9cb480c21790353bfeab5a359f709b37eeb1020d
    Fixes: commit 4f291d7421b7b991fcd61fce47591845725309ff
---
 debian/changelog  | 1 +
 lib/dpkg/fields.c | 7 ++-----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 53db7133f..ea216b520 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -21,6 +21,7 @@ dpkg (1.20.1) UNRELEASED; urgency=medium
   * libdpkg: Fix error message for ending version character in dependency
     parser:
     - Move the version unterminated case before the catchall.
+    - Print the actual wrong character and print what is expected.
   * Portability:
     - libdpkg: When using uselocale(), include <xlocale.h> for locale_t if
       the header is available. Needed on BSDs.
diff --git a/lib/dpkg/fields.c b/lib/dpkg/fields.c
index 5dacdd204..977492c70 100644
--- a/lib/dpkg/fields.c
+++ b/lib/dpkg/fields.c
@@ -577,14 +577,11 @@ f_dependency(struct pkginfo *pkg, struct pkgbin *pkgbin,
           parse_error(ps,
                       _("'%s' field, reference to '%.255s': "
                         "version unterminated"), fip->name, depname.buf);
-        else if (*p == '(')
-          parse_error(ps,
-                      _("'%s' field, reference to '%.255s': "
-                        "version contains '%c'"), fip->name, depname.buf, ')');
         else if (*p != ')')
           parse_error(ps,
                       _("'%s' field, reference to '%.255s': "
-                        "version contains '%c'"), fip->name, depname.buf, ' ');
+                        "version contains '%c' instead of '%c'"),
+                      fip->name, depname.buf, *p, ')');
         varbuf_reset(&version);
         varbuf_add_buf(&version, versionstart, versionlength);
         varbuf_end_str(&version);

-- 
Dpkg.Org's dpkg

Reply via email to