]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.1165 v7.3.1165
authorBram Moolenaar <Bram@vim.org>
Tue, 11 Jun 2013 16:42:36 +0000 (18:42 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 11 Jun 2013 16:42:36 +0000 (18:42 +0200)
Problem:    HP-UX compiler can't handle zero size array. (Charles Cooper)
Solution:   Make the array one item big.

src/regexp.h
src/regexp_nfa.c
src/version.c

index 976927e04acd5aecbe2bca9c3adc4323ff4ecc4f..84e8d19b97e41e2ee5a885f64e63b43a763cb285 100644 (file)
@@ -101,7 +101,7 @@ typedef struct
 #endif
     int                        nsubexp;        /* number of () */
     int                        nstate;
-    nfa_state_T                state[0];       /* actually longer.. */
+    nfa_state_T                state[1];       /* actually longer.. */
 } nfa_regprog_T;
 
 /*
index 40208d40921ed35edd13d04fe0bff775e7d5392b..df82ebf68f93ac9b486c38b3f14ea76444cf8904 100644 (file)
@@ -6391,8 +6391,8 @@ nfa_regcomp(expr, re_flags)
      */
     post2nfa(postfix, post_ptr, TRUE);
 
-    /* Space for compiled regexp */
-    prog_size = sizeof(nfa_regprog_T) + sizeof(nfa_state_T) * nstate;
+    /* allocate the regprog with space for the compiled regexp */
+    prog_size = sizeof(nfa_regprog_T) + sizeof(nfa_state_T) * (nstate - 1);
     prog = (nfa_regprog_T *)lalloc(prog_size, TRUE);
     if (prog == NULL)
        goto fail;
index 0122a8092ab81e98604abab9063c5bdd4f2595a9..8480261a3f464296882ba006d4b12512a4b802bd 100644 (file)
@@ -728,6 +728,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1165,
 /**/
     1164,
 /**/