Patch 7.3.980
Problem:    Regexp logs may contain garbage. Character classes don't work
            correctly for multi-byte characters.
Solution:   Check for end of post list.  Only use "is" functions for
            characters up to 255. (Ken Takata)
Files:      src/regexp_nfa.c


*** ../vim-7.3.979/src/regexp_nfa.c     2013-05-20 21:56:53.000000000 +0200
--- src/regexp_nfa.c    2013-05-20 22:09:01.000000000 +0200
***************
*** 1826,1838 ****
        else if (retval == OK)
            fprintf(f, ">>> NFA engine succeeded !\n");
        fprintf(f, "Regexp: \"%s\"\nPostfix notation (char): \"", expr);
!       for (p=post_start; *p; p++)
        {
            nfa_set_code(*p);
            fprintf(f, "%s, ", code);
        }
        fprintf(f, "\"\nPostfix notation (int): ");
!       for (p=post_start; *p; p++)
                fprintf(f, "%d ", *p);
        fprintf(f, "\n\n");
        fclose(f);
--- 1826,1838 ----
        else if (retval == OK)
            fprintf(f, ">>> NFA engine succeeded !\n");
        fprintf(f, "Regexp: \"%s\"\nPostfix notation (char): \"", expr);
!       for (p = post_start; *p && p < post_end; p++)
        {
            nfa_set_code(*p);
            fprintf(f, "%s, ", code);
        }
        fprintf(f, "\"\nPostfix notation (int): ");
!       for (p = post_start; *p && p < post_end; p++)
                fprintf(f, "%d ", *p);
        fprintf(f, "\n\n");
        fclose(f);
***************
*** 2667,2677 ****
      switch (class)
      {
        case NFA_CLASS_ALNUM:
!           if (isalnum(c))
                return OK;
            break;
        case NFA_CLASS_ALPHA:
!           if (isalpha(c))
                return OK;
            break;
        case NFA_CLASS_BLANK:
--- 2667,2677 ----
      switch (class)
      {
        case NFA_CLASS_ALNUM:
!           if (c >= 1 && c <= 255 && isalnum(c))
                return OK;
            break;
        case NFA_CLASS_ALPHA:
!           if (c >= 1 && c <= 255 && isalpha(c))
                return OK;
            break;
        case NFA_CLASS_BLANK:
***************
*** 2679,2685 ****
                return OK;
            break;
        case NFA_CLASS_CNTRL:
!           if (iscntrl(c))
                return OK;
            break;
        case NFA_CLASS_DIGIT:
--- 2679,2685 ----
                return OK;
            break;
        case NFA_CLASS_CNTRL:
!           if (c >= 1 && c <= 255 && iscntrl(c))
                return OK;
            break;
        case NFA_CLASS_DIGIT:
***************
*** 2687,2693 ****
                return OK;
            break;
        case NFA_CLASS_GRAPH:
!           if (isgraph(c))
                return OK;
            break;
        case NFA_CLASS_LOWER:
--- 2687,2693 ----
                return OK;
            break;
        case NFA_CLASS_GRAPH:
!           if (c >= 1 && c <= 255 && isgraph(c))
                return OK;
            break;
        case NFA_CLASS_LOWER:
***************
*** 2699,2705 ****
                return OK;
            break;
        case NFA_CLASS_PUNCT:
!           if (ispunct(c))
                return OK;
            break;
        case NFA_CLASS_SPACE:
--- 2699,2705 ----
                return OK;
            break;
        case NFA_CLASS_PUNCT:
!           if (c >= 1 && c <= 255 && ispunct(c))
                return OK;
            break;
        case NFA_CLASS_SPACE:
*** ../vim-7.3.979/src/version.c        2013-05-20 21:56:53.000000000 +0200
--- src/version.c       2013-05-20 22:10:54.000000000 +0200
***************
*** 730,731 ****
--- 730,733 ----
  {   /* Add new patch number below this line */
+ /**/
+     980,
  /**/

-- 
Why is "abbreviation" such a long word?

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Raspunde prin e-mail lui