The following commit has been merged in the master branch: commit 6cffe2e524bc845cb8544c9d943faa7f14fece82 Author: Guillem Jover <guil...@debian.org> Date: Thu Dec 8 22:02:36 2011 +0100
libdpkg: Remove unused end pointer argument from pkg_name_is_illegal() diff --git a/lib/dpkg/dpkg-db.h b/lib/dpkg/dpkg-db.h index 712c36c..a2d1b89 100644 --- a/lib/dpkg/dpkg-db.h +++ b/lib/dpkg/dpkg-db.h @@ -299,7 +299,7 @@ enum parsedbflags { pdb_lax_parser = pdb_lax_version_parser, }; -const char *pkg_name_is_illegal(const char *p, const char **ep); +const char *pkg_name_is_illegal(const char *p); int parsedb(const char *filename, enum parsedbflags, struct pkginfo **donep); void copy_dependency_links(struct pkginfo *pkg, struct dependency **updateme, diff --git a/lib/dpkg/fields.c b/lib/dpkg/fields.c index cc827d3..1a0c229 100644 --- a/lib/dpkg/fields.c +++ b/lib/dpkg/fields.c @@ -87,7 +87,7 @@ f_name(struct pkginfo *pigp, struct pkgbin *pifp, { const char *e; - e = pkg_name_is_illegal(value, NULL); + e = pkg_name_is_illegal(value); if (e != NULL) parse_error(ps, _("invalid package name (%.250s)"), e); /* We use the new name, as pkg_db_find_set() may have done a tolower for us. */ @@ -398,7 +398,7 @@ f_dependency(struct pkginfo *pigp, struct pkgbin *pifp, varbuf_add_buf(&depname, depnamestart, depnamelength); varbuf_end_str(&depname); - emsg = pkg_name_is_illegal(depname.buf, NULL); + emsg = pkg_name_is_illegal(depname.buf); if (emsg) parse_error(ps, _("`%s' field, invalid package name `%.255s': %s"), @@ -638,7 +638,7 @@ f_trigaw(struct pkginfo *aw, struct pkgbin *pifp, "this context")); while ((word = scan_word(&value))) { - emsg = pkg_name_is_illegal(word, NULL); + emsg = pkg_name_is_illegal(word); if (emsg) parse_error(ps, _("illegal package name in awaited trigger `%.255s': %s"), diff --git a/lib/dpkg/parsehelp.c b/lib/dpkg/parsehelp.c index 5c2900f..eb1d8c4 100644 --- a/lib/dpkg/parsehelp.c +++ b/lib/dpkg/parsehelp.c @@ -124,7 +124,7 @@ const struct namevalue wantinfos[] = { }; const char * -pkg_name_is_illegal(const char *p, const char **ep) +pkg_name_is_illegal(const char *p) { /* FIXME: _ is deprecated, remove sometime. */ static const char alsoallowed[] = "-+._"; @@ -137,10 +137,7 @@ pkg_name_is_illegal(const char *p, const char **ep) while ((c = *p++) != '\0') if (!isalnum(c) && !strchr(alsoallowed,c)) break; if (!c) return NULL; - if (isspace(c) && ep) { - while (isspace(*p)) p++; - *ep= p; return NULL; - } + snprintf(buf, sizeof(buf), _( "character `%c' not allowed (only letters, digits and characters `%s')"), c, alsoallowed); diff --git a/lib/dpkg/triglib.c b/lib/dpkg/triglib.c index e1d766d..1675a70 100644 --- a/lib/dpkg/triglib.c +++ b/lib/dpkg/triglib.c @@ -176,7 +176,7 @@ trig_classify_byname(const char *name) return &tki_file; } - if (!pkg_name_is_illegal(name, NULL) && !strchr(name, '_')) + if (!pkg_name_is_illegal(name) && !strchr(name, '_')) return &tki_explicit; invalid: @@ -300,7 +300,7 @@ trk_explicit_activate_awaiter(struct pkginfo *aw) noawait = true; *slash = '\0'; } - emsg = pkg_name_is_illegal(buf, NULL); + emsg = pkg_name_is_illegal(buf); if (emsg) ohshit(_("trigger interest file `%.250s' syntax error; " "illegal package name `%.250s': %.250s"), @@ -558,7 +558,7 @@ trig_file_interests_ensure(void) trig_opts = trig_noawait; *slash = '\0'; } - emsg = pkg_name_is_illegal(space, NULL); + emsg = pkg_name_is_illegal(space); if (emsg) ohshit(_("file triggers record mentions illegal " "package name `%.250s' (for interest in file " diff --git a/src/main.c b/src/main.c index bbfcc94..27924cf 100644 --- a/src/main.c +++ b/src/main.c @@ -353,7 +353,7 @@ static void ignoredepends(const struct cmdinfo *cip, const char *value) { } p= copy; while (*p) { - pnerr = pkg_name_is_illegal(p, NULL); + pnerr = pkg_name_is_illegal(p); if (pnerr) ohshite(_("--ignore-depends requires a legal package name. " "`%.250s' is not; %s"), p, pnerr); diff --git a/src/select.c b/src/select.c index 49464cc..af28c3e 100644 --- a/src/select.c +++ b/src/select.c @@ -141,7 +141,7 @@ setselections(const char *const *argv) if (!isspace(c)) ohshit(_("unexpected data after package and selection at line %d"),lno); } - e = pkg_name_is_illegal(namevb.buf, NULL); + e = pkg_name_is_illegal(namevb.buf); if (e) ohshit(_("illegal package name at line %d: %.250s"),lno,e); nv = namevalue_find_by_name(wantinfos, selvb.buf); diff --git a/src/trigcmd.c b/src/trigcmd.c index 09fb346..56158ac 100644 --- a/src/trigcmd.c +++ b/src/trigcmd.c @@ -211,7 +211,7 @@ main(int argc, const char *const *argv) " (or with a --by-package option)")); } if (strcmp(bypackage, "-") && - (badname = pkg_name_is_illegal(bypackage, NULL))) + (badname = pkg_name_is_illegal(bypackage))) ohshit(_("illegal awaited package name '%.250s': %.250s"), bypackage, badname); -- dpkg's main repository -- To UNSUBSCRIBE, email to debian-dpkg-cvs-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org