diff options
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | 2009-07-02 00:01:43 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-07-01 19:16:37 -0700 |
commit | 8cfe5f1cd5dabc3a21bc792327747deefeff6dff (patch) | |
tree | 2b57a1e04baf5b62248845d0225d8b97c2285e61 /xdiff-interface.c | |
parent | Merge branch 'maint' (diff) | |
download | tgif-8cfe5f1cd5dabc3a21bc792327747deefeff6dff.tar.xz |
userdiff: add xdiff_clear_find_func()
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>
Diffstat (limited to 'xdiff-interface.c')
-rw-r--r-- | xdiff-interface.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/xdiff-interface.c b/xdiff-interface.c index b9b0db8d86..01f14fb50f 100644 --- a/xdiff-interface.c +++ b/xdiff-interface.c @@ -309,6 +309,21 @@ void xdiff_set_find_func(xdemitconf_t *xecfg, const char *value, int cflags) } } +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) |