Patch 7.3.1120
Problem:    Crash when regexp logging is enabled.
Solution:   Avoid using NULL pointers. Advance over count argument.
Files:      src/regexp.c, src/regexp_nfa.c


*** ../vim-7.3.1119/src/regexp.c        2013-06-05 12:43:05.000000000 +0200
--- src/regexp.c        2013-06-05 16:27:25.000000000 +0200
***************
*** 6538,6547 ****
            end = next;
        if (op == BRACE_LIMITS)
        {
!           /* Two short ints */
            fprintf(f, " minval %ld, maxval %ld", OPERAND_MIN(s), 
OPERAND_MAX(s));
            s += 8;
        }
        s += 3;
        if (op == ANYOF || op == ANYOF + ADD_NL
                || op == ANYBUT || op == ANYBUT + ADD_NL
--- 6538,6553 ----
            end = next;
        if (op == BRACE_LIMITS)
        {
!           /* Two ints */
            fprintf(f, " minval %ld, maxval %ld", OPERAND_MIN(s), 
OPERAND_MAX(s));
            s += 8;
        }
+       else if (op == BEHIND || op == NOBEHIND)
+       {
+           /* one int */
+           fprintf(f, " count %ld", OPERAND_MIN(s));
+           s += 4;
+       }
        s += 3;
        if (op == ANYOF || op == ANYOF + ADD_NL
                || op == ANYBUT || op == ANYBUT + ADD_NL
*** ../vim-7.3.1119/src/regexp_nfa.c    2013-06-05 12:43:05.000000000 +0200
--- src/regexp_nfa.c    2013-06-05 16:13:25.000000000 +0200
***************
*** 2960,2969 ****
                    sub->list.multi[j].end.col,
                    (int)sub->list.multi[j].end.lnum);
        else
            fprintf(log_fd, "\n *** group %d, start: \"%s\", end: \"%s\"",
                    j,
!                   (char *)sub->list.line[j].start,
!                   (char *)sub->list.line[j].end);
      fprintf(log_fd, "\n");
  }
  #endif
--- 2960,2974 ----
                    sub->list.multi[j].end.col,
                    (int)sub->list.multi[j].end.lnum);
        else
+       {
+           char *s = (char *)sub->list.line[j].start;
+           char *e = (char *)sub->list.line[j].end;
+ 
            fprintf(log_fd, "\n *** group %d, start: \"%s\", end: \"%s\"",
                    j,
!                   s == NULL ? "NULL" : s,
!                   e == NULL ? "NULL" : e);
!       }
      fprintf(log_fd, "\n");
  }
  #endif
*** ../vim-7.3.1119/src/version.c       2013-06-05 12:43:05.000000000 +0200
--- src/version.c       2013-06-05 16:27:14.000000000 +0200
***************
*** 730,731 ****
--- 730,733 ----
  {   /* Add new patch number below this line */
+ /**/
+     1120,
  /**/

-- 
>From "know your smileys":
 |-P    Reaction to unusually ugly C code

 /// 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