Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 69407 | Differences between
and this patch

Collapse All | Expand All

(-)bash/execute_cmd.c~ (-2 / +18 lines)
Lines 3615-3622 Link Here
3615
3615
3616
      if (command == 0)
3616
      if (command == 0)
3617
	{
3617
	{
3618
	  internal_error (_("%s: command not found"), pathname);
3618
	  SHELL_VAR *f, *v;
3619
	  exit (EX_NOTFOUND);	/* Posix.2 says the exit status is 127 */
3619
	  WORD_LIST *cmdlist;
3620
	  WORD_DESC *w;
3621
	  int fval;
3622
	  if( (posixly_correct || interactive_shell == 0) ||
3623
	      (f = find_function ("command_not_found_handle")) == 0)
3624
	    {
3625
	      internal_error (_("%s: command not found"), pathname);
3626
	      exit (EX_NOTFOUND);     /* Posix.2 says the exit status is 127 */
3627
	    }
3628
	  w = make_word("command_not_found_handle");
3629
	  cmdlist = make_word_list(w, (WORD_LIST*)NULL);
3630
3631
	  w = make_word(pathname);
3632
	  cmdlist->next = make_word_list(w, (WORD_LIST*)NULL);
3633
	   
3634
	  fval = execute_shell_function (f, cmdlist);
3635
	  exit(fval);
3620
	}
3636
	}
3621
3637
3622
      /* Execve expects the command name to be in args[0].  So we
3638
      /* Execve expects the command name to be in args[0].  So we
(-)bash/doc/bash.1~ (+7 lines)
Lines 1972-1977 Link Here
1972
.B %
1972
.B %
1973
job identifier.
1973
job identifier.
1974
.TP
1974
.TP
1975
.B command_not_found_handle
1976
The name of a shell function to be called if a command cannot be
1977
found. The return value of this function should be 0, if the command
1978
is available after execution of the function, otherwise 127 (EX_NOTFOUND).
1979
Enabled only in interactive, non POSIX mode shells. This is a Debian
1980
extension.
1981
.TP
1975
.B histchars
1982
.B histchars
1976
The two or three characters which control history expansion
1983
The two or three characters which control history expansion
1977
and tokenization (see
1984
and tokenization (see
(-)bash/doc/bashref.texi~ (+7 lines)
Lines 4734-4739 Link Here
4734
@item UID
4734
@item UID
4735
The numeric real user id of the current user.  This variable is readonly.
4735
The numeric real user id of the current user.  This variable is readonly.
4736
4736
4737
@item command_not_found_handle
4738
The name of a shell function to be called if a command cannot be
4739
found. The return value of this function should be 0, if the command
4740
is available after execution of the function, otherwise 127 (EX_NOTFOUND).
4741
Enabled only in interactive, non POSIX mode shells. This is a Debian
4742
extension.
4743
4737
@end vtable
4744
@end vtable
4738
4745
4739
@node Bash Features
4746
@node Bash Features

Return to bug 69407