1665168050.FILE5_43-59-ga960a2ad.for-indirect-magic-reset-printed-something-and-need-separator-so-that.patch 1017 B

123456789101112131415161718192021222324252627
  1. Subject: For indirect magic, reset printed_something and need_separator so that (...)
  2. Origin: FILE5_43-59-ga960a2ad <https://github.com/file/file/commit/FILE5_43-59-ga960a2ad>
  3. Upstream-Author: Christos Zoulas <christos@zoulas.com>
  4. Date: Fri Oct 7 18:40:50 2022 +0000
  5. for indirect magic, reset printed_something and need_separator so that
  6. we don't trigger printing a separator (Christoph Biedl)
  7. --- a/src/softmagic.c
  8. +++ b/src/softmagic.c
  9. @@ -1860,11 +1860,15 @@
  10. for (mlp = ms->mlist[0]->next; mlp != ms->mlist[0];
  11. mlp = mlp->next)
  12. {
  13. + int xprinted_something = 0;
  14. + int xneed_separator = 0;
  15. if ((rv = match(ms, mlp->magic, mlp->magic_rxcomp,
  16. mlp->nmagic, &bb, 0, BINTEST, text, 0, indir_count,
  17. - name_count, printed_something, need_separator,
  18. + name_count, &xprinted_something, &xneed_separator,
  19. NULL, NULL)) != 0)
  20. break;
  21. + *printed_something |= xprinted_something;
  22. + *need_separator |= xneed_separator;
  23. }
  24. if ((ms->flags & MAGIC_DEBUG) != 0)