emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/src/fontset.c,v


From: Kenichi Handa
Subject: [Emacs-diffs] Changes to emacs/src/fontset.c,v
Date: Sun, 15 Jun 2008 12:23:28 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Kenichi Handa <handa>   08/06/15 12:23:27

Index: fontset.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/fontset.c,v
retrieving revision 1.132
retrieving revision 1.133
diff -u -b -r1.132 -r1.133
--- fontset.c   8 Jun 2008 09:01:28 -0000       1.132
+++ fontset.c   15 Jun 2008 12:23:27 -0000      1.133
@@ -1005,7 +1005,7 @@
     {
       /* We must at first update the cached data.  */
       unsigned char *regex, *p0, *p1;
-      int ndashes = 0, nstars = 0;
+      int ndashes = 0, nstars = 0, nplus = 0;
 
       for (p0 = SDATA (pattern); *p0; p0++)
        {
@@ -1013,15 +1013,17 @@
            ndashes++;
          else if (*p0 == '*')
            nstars++;
+         else if (*p0 == '+')
+           nplus++;
        }
 
       /* If PATTERN is not full XLFD we conert "*" to ".*".  Otherwise
         we convert "*" to "[^-]*" which is much faster in regular
         expression matching.  */
       if (ndashes < 14)
-       p1 = regex = (unsigned char *) alloca (SBYTES (pattern) + 2 * nstars + 
1);
+       p1 = regex = (unsigned char *) alloca (SBYTES (pattern) + 2 * nstars + 
2 * nplus + 1);
       else
-       p1 = regex = (unsigned char *) alloca (SBYTES (pattern) + 5 * nstars + 
1);
+       p1 = regex = (unsigned char *) alloca (SBYTES (pattern) + 5 * nstars + 
2 * nplus + 1);
 
       *p1++ = '^';
       for (p0 = SDATA (pattern); *p0; p0++)
@@ -1036,6 +1038,8 @@
            }
          else if (*p0 == '?')
            *p1++ = '.';
+         else if (*p0 == '+')
+           *p1++ = '\\', *p1++ = '+';
          else
            *p1++ = *p0;
        }




reply via email to

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