Blob Blame History Raw
diff -urp file-5.33.orig/src/softmagic.c file-5.33/src/softmagic.c
--- file-5.33.orig/src/softmagic.c	2018-04-15 14:49:15.000000000 -0400
+++ file-5.33/src/softmagic.c	2020-12-14 12:21:13.298285158 -0500
@@ -1758,7 +1758,9 @@ file_strncmp(const char *s1, const char
 	 */
 	const unsigned char *a = (const unsigned char *)s1;
 	const unsigned char *b = (const unsigned char *)s2;
-	const unsigned char *eb = b + len;
+	uint32_t ws = flags & (STRING_COMPACT_WHITESPACE |
+		STRING_COMPACT_OPTIONAL_WHITESPACE);
+	const unsigned char *eb = b + (ws ? strlen(s2) : len);
 	uint64_t v;
 
 	/*