emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 5/5] Fix file magic for pbm files with comments


From: Claudio Bley
Subject: [PATCH 5/5] Fix file magic for pbm files with comments
Date: Tue, 29 Oct 2013 09:10:22 +0100
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Goj┼Ź) APEL/10.8 Emacs/24.3.50 (i686-pc-mingw32) MULE/6.0 (HANACHIRUSATO)

Comments in NetPBM files are allowed to occur in the middle of a
token.
---
 lisp/image.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/image.el b/lisp/image.el
index 91cc3ad..e56328b 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -34,7 +34,10 @@
 
 (defconst image-type-header-regexps
   `(("\\`/[\t\n\r ]*\\*.*XPM.\\*/" . xpm)
-    ("\\`P[1-6][[:space:]]+\\(?:#.*[[:space:]]+\\)*[0-9]+[[:space:]]+[0-9]+" . 
pbm)
+    ("\\`P[1-6]\\\(?:\
+\\(?:\\(?:#[^\r\n]*[\r\n]\\)?[[:space:]]\\)+\
+\\(?:\\(?:#[^\r\n]*[\r\n]\\)?[0-9]\\)+\
+\\)\\{2\\}" . pbm)
     ("\\`GIF8[79]a" . gif)
     ("\\`\x89PNG\r\n\x1a\n" . png)
     ("\\`[\t\n\r ]*#define \\([a-z0-9_]+\\)_width [0-9]+\n\
-- 
1.8.4.msysgit.0





reply via email to

[Prev in Thread] Current Thread [Next in Thread]