diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2022-02-15 08:24:44 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2022-02-15 08:24:44 -0500 |
commit | 263d176f04f2ab727972d5f8c77ef8344c613521 (patch) | |
tree | e302f81e36f4709ebfe13b3f08c2ebc904157cf7 /src/main.c | |
parent | 10a13c64cc5ee3ff16caa77a7b809702cff38595 (diff) | |
download | cleanpath-263d176f04f2ab727972d5f8c77ef8344c613521.tar.gz |
Do not touch exported functions in --all mode
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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]); |