MSVC doesn't munge the non-constant expression, so use xmalloc instead.
Signed-off-by: Marius Storm-Olsen <redacted>
---
builtin-apply.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/builtin-apply.c b/builtin-apply.c
index ae11b41..0f19965 100644
--- a/builtin-apply.c
+++ b/builtin-apply.c
@@ -1875,7 +1875,7 @@ static int match_fragment(struct image *img,
size_t imgoff = 0;
size_t preoff = 0;
size_t postlen = postimage->len;
- size_t imglen[preimage->nr];
+ size_t *imglen = xmalloc(sizeof(size_t) * preimage->nr);
for (i = 0; i < preimage->nr; i++) {
size_t prelen = preimage->line[i].len;
@@ -1901,6 +1901,7 @@ static int match_fragment(struct image *img,
memcpy(fixed_buf, img->buf + try, imgoff);
for (i = 0; i < preimage->nr; i++)
preimage->line[i].len = imglen[i];
+ free(imglen);
/*
* Update the preimage buffer and the postimage context lines.
--
1.6.3.msysgit.0.18.gef407