summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 725cf7b)
raw | patch | inline | side by side (parent: 725cf7b)
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Wed, 1 Jul 2009 22:01:43 +0000 (00:01 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 2 Jul 2009 02:16:37 +0000 (19:16 -0700) |
xdiff_set_find_func() is used to set user defined regular expressions
for finding function signatures. Add xdiff_clear_find_func(), which
frees the memory allocated by the former, making the API complete.
Also, use the new function in diff.c (the only call site of
xdiff_set_find_func()) to clean up after ourselves.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
for finding function signatures. Add xdiff_clear_find_func(), which
frees the memory allocated by the former, making the API complete.
Also, use the new function in diff.c (the only call site of
xdiff_set_find_func()) to clean up after ourselves.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff.c | patch | blob | history | |
xdiff-interface.c | patch | blob | history | |
xdiff-interface.h | patch | blob | history |
index 43835d756c2c2c7ec579e1c38804fe33a706944f..892921cdc71e75b7dfecf9bc3fcc04147576c1a3 100644 (file)
--- a/diff.c
+++ b/diff.c
free(mf1.ptr);
if (textconv_two)
free(mf2.ptr);
+ xdiff_clear_find_func(&xecfg);
}
free_ab_and_return:
diff --git a/xdiff-interface.c b/xdiff-interface.c
index b9b0db8d86615d6ca1046b932772f3d9750a8062..01f14fb50f7cf1387898a0c8db44f966ce07b720 100644 (file)
--- a/xdiff-interface.c
+++ b/xdiff-interface.c
}
}
+void xdiff_clear_find_func(xdemitconf_t *xecfg)
+{
+ if (xecfg->find_func) {
+ int i;
+ struct ff_regs *regs = xecfg->find_func_priv;
+
+ for (i = 0; i < regs->nr; i++)
+ regfree(®s->array[i].re);
+ free(regs->array);
+ free(regs);
+ xecfg->find_func = NULL;
+ xecfg->find_func_priv = NULL;
+ }
+}
+
int git_xmerge_style = -1;
int git_xmerge_config(const char *var, const char *value, void *cb)
diff --git a/xdiff-interface.h b/xdiff-interface.h
index 7352b9a9c204c2b1d4ca9df5ce040fe22d6f521c..55572c39a10dee336355f816b324946fc087d6e7 100644 (file)
--- a/xdiff-interface.h
+++ b/xdiff-interface.h
int buffer_is_binary(const char *ptr, unsigned long size);
extern void xdiff_set_find_func(xdemitconf_t *xecfg, const char *line, int cflags);
+extern void xdiff_clear_find_func(xdemitconf_t *xecfg);
extern int git_xmerge_config(const char *var, const char *value, void *cb);
extern int git_xmerge_style;