diff --git a/hgext/keyword.py b/hgext/keyword.py
index f4c859293ed43b6348d4462493863dd0319807b4_aGdleHQva2V5d29yZC5weQ==..07893690c435ba63b72ec169e8ee3e8fa02ef383_aGdleHQva2V5d29yZC5weQ== 100644
--- a/hgext/keyword.py
+++ b/hgext/keyword.py
@@ -680,7 +680,8 @@
         # not make sense
         if (fctx._filerev is None and
             (self._repo._encodefilterpats or
-             kwt.match(fctx.path()) and not 'l' in fctx.flags()) or
+             kwt.match(fctx.path()) and not 'l' in fctx.flags() or
+             self.size() - 4 == fctx.size()) or
             self.size() == fctx.size()):
             return self._filelog.cmp(self._filenode, fctx.data())
         return True
diff --git a/tests/test-keyword.t b/tests/test-keyword.t
index f4c859293ed43b6348d4462493863dd0319807b4_dGVzdHMvdGVzdC1rZXl3b3JkLnQ=..07893690c435ba63b72ec169e8ee3e8fa02ef383_dGVzdHMvdGVzdC1rZXl3b3JkLnQ= 100644
--- a/tests/test-keyword.t
+++ b/tests/test-keyword.t
@@ -160,10 +160,8 @@
   ignore $Id$
   a
 
-Test hook execution
-
   $ diff a hooktest
 
   $ cp $HGRCPATH.nohooks $HGRCPATH
   $ rm hooktest
 
@@ -165,8 +163,28 @@
   $ diff a hooktest
 
   $ cp $HGRCPATH.nohooks $HGRCPATH
   $ rm hooktest
 
+hg status of kw-ignored binary file starting with '\1\n'
+
+  $ printf '\1\nfoo' > i
+  $ hg -q commit -Am metasep i
+  $ hg status
+  $ printf '\1\nbar' > i
+  $ hg status
+  M i
+  $ hg -q commit -m "modify metasep" i
+  $ hg status --rev 2:3
+  M i
+  $ touch empty
+  $ hg -q commit -A -m "another file"
+  $ hg status -A --rev 3:4 i
+  C i
+
+  $ hg -q strip -n 2
+
+Test hook execution
+
 bundle
 
   $ hg bundle --base null ../kw.hg