file: backport patch to fix a 5.39 regression

This bug is causing diffoscope to fail to build with file 5.39.
This commit is contained in:
Pierre Bourdon
2020-06-28 11:18:38 +02:00
parent 87dbe6d797
commit cbb288204d
2 changed files with 19 additions and 0 deletions
@@ -0,0 +1,13 @@
diff --git a/src/funcs.c b/src/funcs.c
index 299b8f022..ecbfa28c5 100644
--- a/src/funcs.c
+++ b/src/funcs.c
@@ -93,7 +93,7 @@ file_checkfmt(char *msg, size_t mlen, const char *fmt)
if (*++p == '%')
continue;
// Skip uninteresting.
- while (strchr("0.'+- ", *p) != NULL)
+ while (strchr("#0.'+- ", *p) != NULL)
p++;
if (*p == '*') {
if (msg)