From 16619a235bae49c11d28ac462dc2d42fcfea44ba Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 11 Jun 2013 18:42:36 +0200 Subject: [PATCH] updated for version 7.3.1165 Problem: HP-UX compiler can't handle zero size array. (Charles Cooper) Solution: Make the array one item big. --- src/regexp.h | 2 +- src/regexp_nfa.c | 4 ++-- src/version.c | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/regexp.h b/src/regexp.h index 976927e04..84e8d19b9 100644 --- a/src/regexp.h +++ b/src/regexp.h @@ -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; /* diff --git a/src/regexp_nfa.c b/src/regexp_nfa.c index 40208d409..df82ebf68 100644 --- a/src/regexp_nfa.c +++ b/src/regexp_nfa.c @@ -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; diff --git a/src/version.c b/src/version.c index 0122a8092..8480261a3 100644 --- a/src/version.c +++ b/src/version.c @@ -728,6 +728,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1165, /**/ 1164, /**/ -- 2.50.1