Skip to content
Browse files

Fix #213. You can now remove autoloaded functions.

Oddly enough, the code is here, but is internal function.
  • Loading branch information...
1 parent 97e731e commit 1349d129c51e0c698645c3806601a7c9ebfcef95 Konrad Borowski committed
Showing with 5 additions and 5 deletions.
  1. +1 −1 builtin.cpp
  2. +1 −4 function.cpp
  3. +3 −0 function.h
View
2 builtin.cpp
@@ -1339,7 +1339,7 @@ static int builtin_functions(parser_t &parser, wchar_t **argv)
{
int i;
for (i=woptind; i<argc; i++)
- function_remove(argv[i]);
+ function_remove_ignore_autoload(argv[i]);
return STATUS_BUILTIN_OK;
}
else if (desc)
View
5 function.cpp
@@ -61,9 +61,6 @@ function_autoload_t::function_autoload_t() : autoload_t(L"fish_function_path", N
{
}
-/** Removes a function from our internal table, returning true if it was found and false if not */
-static bool function_remove_ignore_autoload(const wcstring &name);
-
/** Callback when an autoloaded function is removed */
void function_autoload_t::command_removed(const wcstring &cmd)
{
@@ -220,7 +217,7 @@ int function_exists_no_autoload(const wcstring &cmd, const env_vars_snapshot_t &
return loaded_functions.find(cmd) != loaded_functions.end() || function_autoloader.can_load(cmd, vars);
}
-static bool function_remove_ignore_autoload(const wcstring &name)
+bool function_remove_ignore_autoload(const wcstring &name)
{
scoped_lock lock(functions_lock);
bool erased = (loaded_functions.erase(name) > 0);
View
3 function.h
@@ -95,6 +95,9 @@ void function_init();
/** Add a function. */
void function_add(const function_data_t &data, const parser_t &parser);
+/** Removes a function from our internal table, returning true if it was found and false if not */
+bool function_remove_ignore_autoload(const wcstring &name);
+
/**
Remove the function with the specified name.
*/

0 comments on commit 1349d12

Please sign in to comment.
Something went wrong with that request. Please try again.