|
Karsten Hopp |
4b5efe |
To: vim_dev@googlegroups.com
|
|
Karsten Hopp |
4b5efe |
Subject: Patch 7.3.980
|
|
Karsten Hopp |
4b5efe |
Fcc: outbox
|
|
Karsten Hopp |
4b5efe |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
Karsten Hopp |
4b5efe |
Mime-Version: 1.0
|
|
Karsten Hopp |
4b5efe |
Content-Type: text/plain; charset=UTF-8
|
|
Karsten Hopp |
4b5efe |
Content-Transfer-Encoding: 8bit
|
|
Karsten Hopp |
4b5efe |
------------
|
|
Karsten Hopp |
4b5efe |
|
|
Karsten Hopp |
4b5efe |
Patch 7.3.980
|
|
Karsten Hopp |
4b5efe |
Problem: Regexp logs may contain garbage. Character classes don't work
|
|
Karsten Hopp |
4b5efe |
correctly for multi-byte characters.
|
|
Karsten Hopp |
4b5efe |
Solution: Check for end of post list. Only use "is" functions for
|
|
Karsten Hopp |
4b5efe |
characters up to 255. (Ken Takata)
|
|
Karsten Hopp |
4b5efe |
Files: src/regexp_nfa.c
|
|
Karsten Hopp |
4b5efe |
|
|
Karsten Hopp |
4b5efe |
|
|
Karsten Hopp |
4b5efe |
*** ../vim-7.3.979/src/regexp_nfa.c 2013-05-20 21:56:53.000000000 +0200
|
|
Karsten Hopp |
4b5efe |
--- src/regexp_nfa.c 2013-05-20 22:09:01.000000000 +0200
|
|
Karsten Hopp |
4b5efe |
***************
|
|
Karsten Hopp |
4b5efe |
*** 1826,1838 ****
|
|
Karsten Hopp |
4b5efe |
else if (retval == OK)
|
|
Karsten Hopp |
4b5efe |
fprintf(f, ">>> NFA engine succeeded !\n");
|
|
Karsten Hopp |
4b5efe |
fprintf(f, "Regexp: \"%s\"\nPostfix notation (char): \"", expr);
|
|
Karsten Hopp |
4b5efe |
! for (p=post_start; *p; p++)
|
|
Karsten Hopp |
4b5efe |
{
|
|
Karsten Hopp |
4b5efe |
nfa_set_code(*p);
|
|
Karsten Hopp |
4b5efe |
fprintf(f, "%s, ", code);
|
|
Karsten Hopp |
4b5efe |
}
|
|
Karsten Hopp |
4b5efe |
fprintf(f, "\"\nPostfix notation (int): ");
|
|
Karsten Hopp |
4b5efe |
! for (p=post_start; *p; p++)
|
|
Karsten Hopp |
4b5efe |
fprintf(f, "%d ", *p);
|
|
Karsten Hopp |
4b5efe |
fprintf(f, "\n\n");
|
|
Karsten Hopp |
4b5efe |
fclose(f);
|
|
Karsten Hopp |
4b5efe |
--- 1826,1838 ----
|
|
Karsten Hopp |
4b5efe |
else if (retval == OK)
|
|
Karsten Hopp |
4b5efe |
fprintf(f, ">>> NFA engine succeeded !\n");
|
|
Karsten Hopp |
4b5efe |
fprintf(f, "Regexp: \"%s\"\nPostfix notation (char): \"", expr);
|
|
Karsten Hopp |
4b5efe |
! for (p = post_start; *p && p < post_end; p++)
|
|
Karsten Hopp |
4b5efe |
{
|
|
Karsten Hopp |
4b5efe |
nfa_set_code(*p);
|
|
Karsten Hopp |
4b5efe |
fprintf(f, "%s, ", code);
|
|
Karsten Hopp |
4b5efe |
}
|
|
Karsten Hopp |
4b5efe |
fprintf(f, "\"\nPostfix notation (int): ");
|
|
Karsten Hopp |
4b5efe |
! for (p = post_start; *p && p < post_end; p++)
|
|
Karsten Hopp |
4b5efe |
fprintf(f, "%d ", *p);
|
|
Karsten Hopp |
4b5efe |
fprintf(f, "\n\n");
|
|
Karsten Hopp |
4b5efe |
fclose(f);
|
|
Karsten Hopp |
4b5efe |
***************
|
|
Karsten Hopp |
4b5efe |
*** 2667,2677 ****
|
|
Karsten Hopp |
4b5efe |
switch (class)
|
|
Karsten Hopp |
4b5efe |
{
|
|
Karsten Hopp |
4b5efe |
case NFA_CLASS_ALNUM:
|
|
Karsten Hopp |
4b5efe |
! if (isalnum(c))
|
|
Karsten Hopp |
4b5efe |
return OK;
|
|
Karsten Hopp |
4b5efe |
break;
|
|
Karsten Hopp |
4b5efe |
case NFA_CLASS_ALPHA:
|
|
Karsten Hopp |
4b5efe |
! if (isalpha(c))
|
|
Karsten Hopp |
4b5efe |
return OK;
|
|
Karsten Hopp |
4b5efe |
break;
|
|
Karsten Hopp |
4b5efe |
case NFA_CLASS_BLANK:
|
|
Karsten Hopp |
4b5efe |
--- 2667,2677 ----
|
|
Karsten Hopp |
4b5efe |
switch (class)
|
|
Karsten Hopp |
4b5efe |
{
|
|
Karsten Hopp |
4b5efe |
case NFA_CLASS_ALNUM:
|
|
Karsten Hopp |
4b5efe |
! if (c >= 1 && c <= 255 && isalnum(c))
|
|
Karsten Hopp |
4b5efe |
return OK;
|
|
Karsten Hopp |
4b5efe |
break;
|
|
Karsten Hopp |
4b5efe |
case NFA_CLASS_ALPHA:
|
|
Karsten Hopp |
4b5efe |
! if (c >= 1 && c <= 255 && isalpha(c))
|
|
Karsten Hopp |
4b5efe |
return OK;
|
|
Karsten Hopp |
4b5efe |
break;
|
|
Karsten Hopp |
4b5efe |
case NFA_CLASS_BLANK:
|
|
Karsten Hopp |
4b5efe |
***************
|
|
Karsten Hopp |
4b5efe |
*** 2679,2685 ****
|
|
Karsten Hopp |
4b5efe |
return OK;
|
|
Karsten Hopp |
4b5efe |
break;
|
|
Karsten Hopp |
4b5efe |
case NFA_CLASS_CNTRL:
|
|
Karsten Hopp |
4b5efe |
! if (iscntrl(c))
|
|
Karsten Hopp |
4b5efe |
return OK;
|
|
Karsten Hopp |
4b5efe |
break;
|
|
Karsten Hopp |
4b5efe |
case NFA_CLASS_DIGIT:
|
|
Karsten Hopp |
4b5efe |
--- 2679,2685 ----
|
|
Karsten Hopp |
4b5efe |
return OK;
|
|
Karsten Hopp |
4b5efe |
break;
|
|
Karsten Hopp |
4b5efe |
case NFA_CLASS_CNTRL:
|
|
Karsten Hopp |
4b5efe |
! if (c >= 1 && c <= 255 && iscntrl(c))
|
|
Karsten Hopp |
4b5efe |
return OK;
|
|
Karsten Hopp |
4b5efe |
break;
|
|
Karsten Hopp |
4b5efe |
case NFA_CLASS_DIGIT:
|
|
Karsten Hopp |
4b5efe |
***************
|
|
Karsten Hopp |
4b5efe |
*** 2687,2693 ****
|
|
Karsten Hopp |
4b5efe |
return OK;
|
|
Karsten Hopp |
4b5efe |
break;
|
|
Karsten Hopp |
4b5efe |
case NFA_CLASS_GRAPH:
|
|
Karsten Hopp |
4b5efe |
! if (isgraph(c))
|
|
Karsten Hopp |
4b5efe |
return OK;
|
|
Karsten Hopp |
4b5efe |
break;
|
|
Karsten Hopp |
4b5efe |
case NFA_CLASS_LOWER:
|
|
Karsten Hopp |
4b5efe |
--- 2687,2693 ----
|
|
Karsten Hopp |
4b5efe |
return OK;
|
|
Karsten Hopp |
4b5efe |
break;
|
|
Karsten Hopp |
4b5efe |
case NFA_CLASS_GRAPH:
|
|
Karsten Hopp |
4b5efe |
! if (c >= 1 && c <= 255 && isgraph(c))
|
|
Karsten Hopp |
4b5efe |
return OK;
|
|
Karsten Hopp |
4b5efe |
break;
|
|
Karsten Hopp |
4b5efe |
case NFA_CLASS_LOWER:
|
|
Karsten Hopp |
4b5efe |
***************
|
|
Karsten Hopp |
4b5efe |
*** 2699,2705 ****
|
|
Karsten Hopp |
4b5efe |
return OK;
|
|
Karsten Hopp |
4b5efe |
break;
|
|
Karsten Hopp |
4b5efe |
case NFA_CLASS_PUNCT:
|
|
Karsten Hopp |
4b5efe |
! if (ispunct(c))
|
|
Karsten Hopp |
4b5efe |
return OK;
|
|
Karsten Hopp |
4b5efe |
break;
|
|
Karsten Hopp |
4b5efe |
case NFA_CLASS_SPACE:
|
|
Karsten Hopp |
4b5efe |
--- 2699,2705 ----
|
|
Karsten Hopp |
4b5efe |
return OK;
|
|
Karsten Hopp |
4b5efe |
break;
|
|
Karsten Hopp |
4b5efe |
case NFA_CLASS_PUNCT:
|
|
Karsten Hopp |
4b5efe |
! if (c >= 1 && c <= 255 && ispunct(c))
|
|
Karsten Hopp |
4b5efe |
return OK;
|
|
Karsten Hopp |
4b5efe |
break;
|
|
Karsten Hopp |
4b5efe |
case NFA_CLASS_SPACE:
|
|
Karsten Hopp |
4b5efe |
*** ../vim-7.3.979/src/version.c 2013-05-20 21:56:53.000000000 +0200
|
|
Karsten Hopp |
4b5efe |
--- src/version.c 2013-05-20 22:10:54.000000000 +0200
|
|
Karsten Hopp |
4b5efe |
***************
|
|
Karsten Hopp |
4b5efe |
*** 730,731 ****
|
|
Karsten Hopp |
4b5efe |
--- 730,733 ----
|
|
Karsten Hopp |
4b5efe |
{ /* Add new patch number below this line */
|
|
Karsten Hopp |
4b5efe |
+ /**/
|
|
Karsten Hopp |
4b5efe |
+ 980,
|
|
Karsten Hopp |
4b5efe |
/**/
|
|
Karsten Hopp |
4b5efe |
|
|
Karsten Hopp |
4b5efe |
--
|
|
Karsten Hopp |
4b5efe |
Why is "abbreviation" such a long word?
|
|
Karsten Hopp |
4b5efe |
|
|
Karsten Hopp |
4b5efe |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
Karsten Hopp |
4b5efe |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
Karsten Hopp |
4b5efe |
\\\ an exciting new programming language -- http://www.Zimbu.org ///
|
|
Karsten Hopp |
4b5efe |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|