From 263d176f04f2ab727972d5f8c77ef8344c613521 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Tue, 15 Feb 2022 08:24:44 -0500 Subject: Do not touch exported functions in --all mode --- src/main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main.c b/src/main.c index ffab0ac..86f3c26 100644 --- a/src/main.c +++ b/src/main.c @@ -247,6 +247,14 @@ int main(int argc, char *argv[], char *arge[]) { if (key_end) { *key_end = '\0'; } + + // Don't touch exported functions + if (!strncmp(key, "BASH_FUNC_", strlen("BASH_FUNC_")) || !strncmp(path->data, "()", strlen("()"))) { + free(path); + free(key); + continue; + } + // Remove patterns from sys_var for (size_t p = 0; p < CLEANPATH_PART_MAX && pattern[p] != NULL; p++) { cleanpath_filter(path, filter_mode, pattern[p]); -- cgit