Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #16008
| From | Phi Debian <phi.debian@gmail.com> |
|---|---|
| Newsgroups | gnu.bash.bug |
| Subject | Patch: command_not_found_handle() flaw |
| Date | 2020-03-10 18:39 +0100 |
| Message-ID | <mailman.2421.1583861960.2412.bug-bash@gnu.org> (permalink) |
| References | <CAJOr74gyTOEnYNCG3EPAVJq5VkmJxJ_9tv_TwbmKPBGugdvnWw@mail.gmail.com> <CAJOr74iY-Miyjvh=02x4jDECqckpcau3aiCU+AVu2Qb+Y+YL-Q@mail.gmail.com> |
diff --git a/execute_cmd.c b/execute_cmd.c
index 3864986d..ef32631a 100644
--- a/execute_cmd.c
+++ b/execute_cmd.c
@@ -5370,6 +5370,20 @@ execute_disk_command (words, redirects,
command_line, pipe_in, pipe_out,
command = search_for_command (pathname, CMDSRCH_HASH|(stdpath ?
CMDSRCH_STDPATH : 0));
QUIT;
+
+#define PHI_CNF 1
+#if(PHI_CNF)
+ if (command == 0)
+ { hookf = find_function (NOTFOUND_HOOK);
+ if(hookf)
+ { wl = make_word_list (make_word (NOTFOUND_HOOK), words);
+ result=execute_shell_function (hookf, wl);
+ wl->next=0;
+ dispose_words(wl);
+ goto parent_return;
+ }
+ }
+#endif // PHI_CNF
if (command)
{
@@ -5448,7 +5462,10 @@ execute_disk_command (words, redirects,
command_line, pipe_in, pipe_out,
if (command == 0)
{
+#if(!PHI_CNF)
+ // with PHI_CNF==1 hookf==0
hookf = find_function (NOTFOUND_HOOK);
+#endif
if (hookf == 0)
{
/* Make sure filenames are displayed using printable
characters */
Back to gnu.bash.bug | Previous | Next | Find similar
Patch: command_not_found_handle() flaw Phi Debian <phi.debian@gmail.com> - 2020-03-10 18:39 +0100
csiph-web