Commit 8e4bad69 authored by Guillem Jover's avatar Guillem Jover

dpkg-query: Refactor pkg_infodb_is_internal() from pkg_infodb_print_filename()

parent 02566928
......@@ -566,15 +566,24 @@ showpackages(const char *const *argv)
return failures;
}
static void
pkg_infodb_print_filename(const char *filename, const char *filetype)
static bool
pkg_infodb_is_internal(const char *filetype)
{
/* Do not expose internal database files. */
if (strcmp(filetype, LISTFILE) == 0 ||
strcmp(filetype, CONFFILESFILE) == 0)
return;
return true;
if (strlen(filetype) > MAXCONTROLFILENAME)
return true;
return false;
}
static void
pkg_infodb_print_filename(const char *filename, const char *filetype)
{
if (pkg_infodb_is_internal(filetype))
return;
printf("%s\n", filename);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment