Mercurial > vim
diff src/regexp_nfa.c @ 4746:d1376091d18b v7.3.1120
updated for version 7.3.1120
Problem: Crash when regexp logging is enabled.
Solution: Avoid using NULL pointers. Advance over count argument.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 05 Jun 2013 16:33:10 +0200 |
parents | a62695305e03 |
children | 4b9503f0c7d3 |
line wrap: on
line diff
--- a/src/regexp_nfa.c +++ b/src/regexp_nfa.c @@ -2960,10 +2960,15 @@ log_subexpr(sub) 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, - (char *)sub->list.line[j].start, - (char *)sub->list.line[j].end); + s == NULL ? "NULL" : s, + e == NULL ? "NULL" : e); + } fprintf(log_fd, "\n"); } #endif