qemacs-commit
[Top][All Lists]
Advanced

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

[Qemacs-commit] qemacs html.c


From: Charlie Gordon
Subject: [Qemacs-commit] qemacs html.c
Date: Fri, 07 Mar 2014 02:25:20 +0000

CVSROOT:        /sources/qemacs
Module name:    qemacs
Changes by:     Charlie Gordon <chqrlie>        14/03/07 02:25:20

Modified files:
        .              : html.c 

Log message:
        fix html-mode probe function
        
        * prevent spurious detection of html contents (still too lenient)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/html.c?cvsroot=qemacs&r1=1.29&r2=1.30

Patches:
Index: html.c
===================================================================
RCS file: /sources/qemacs/qemacs/html.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- html.c      10 Feb 2014 03:24:34 -0000      1.29
+++ html.c      7 Mar 2014 02:25:20 -0000       1.30
@@ -828,6 +828,14 @@
     int c, score;
 
     score = 0;
+
+    while (qe_isspace(*p))
+        p++;
+    if (*p != '<')
+        return 0;
+    if (p[1] != '!' && p[1] != '?' && !qe_isalpha(p[1]))
+        return 0;
+
     for (;;) {
         c = *p;
         if (c == '\0')
@@ -835,7 +843,7 @@
         if (c < 32 && !(magic & (1 << c)))
             return 0;
         if (c == '<' && stristart(cs8(p), "<html", NULL))
-            score = 100;
+            score = 95;
         p++;
     }
     return score;



reply via email to

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