summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2014-06-06 13:57:23 -0400
committerChet Ramey <chet.ramey@case.edu>2014-06-06 13:57:23 -0400
commit66119cfc34d33cc1de7f760c636f7c1f3e74e70e (patch)
tree71780fcaf8342deb0de5c74e1cbc0521cf36220d
parented508a6323cea85727d6dfcca6ac801a60727a39 (diff)
downloadbash-66119cfc34d33cc1de7f760c636f7c1f3e74e70e.tar.gz
commit bash-20140530 snapshot
-rw-r--r--CWRU/CWRU.chlog8
-rw-r--r--doc/bash.12
-rw-r--r--doc/bashref.texi2
-rw-r--r--execute_cmd.c5
-rw-r--r--lib/readline/input.c2
-rw-r--r--patchlevel.h2
6 files changed, 15 insertions, 6 deletions
diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog
index 6a202fb3..9c1cae94 100644
--- a/CWRU/CWRU.chlog
+++ b/CWRU/CWRU.chlog
@@ -6291,3 +6291,11 @@ arrayfunc.c
- bind_array_var_internal: make sure ENTRY no longer has invisible
attribute before returning. Fixes bug reported by Geir Hauge
<geir.hauge@gmail.com>
+
+ 5/22
+ ----
+execute_cmd.c
+ - shell_execve: if execve fails and we return 127 or 126, make sure to
+ set last_command_exit_value if a call to file_error or report_error
+ causes the shell to exit. This ensures that the shell exits with
+ the right value.
diff --git a/doc/bash.1 b/doc/bash.1
index b96c6a46..023cd9d3 100644
--- a/doc/bash.1
+++ b/doc/bash.1
@@ -6909,7 +6909,7 @@ or was started without job control.
.TP
\fBbind\fP [\fB\-m\fP \fIkeymap\fP] \fIkeyseq\fP:\fIfunction\-name\fP
.TP
-\fBbind\fP \fIreadline\-command\fP
+\fBbind\fP [\fB\-m\fP \fIkeymap\fP] \fIkeyseq\fP:\fIreadline\-command\fP
.PD
Display current
.B readline
diff --git a/doc/bashref.texi b/doc/bashref.texi
index 490ad084..d552757d 100644
--- a/doc/bashref.texi
+++ b/doc/bashref.texi
@@ -3773,7 +3773,7 @@ bind [-m @var{keymap}] [-q @var{function}] [-u @var{function}] [-r @var{keyseq}]
bind [-m @var{keymap}] -f @var{filename}
bind [-m @var{keymap}] -x @var{keyseq:shell-command}
bind [-m @var{keymap}] @var{keyseq:function-name}
-bind @var{readline-command}
+bind [-m @var{keymap}] @var{keyseq:readline-command}
@end example
Display current Readline (@pxref{Command Line Editing})
diff --git a/execute_cmd.c b/execute_cmd.c
index d9dc18b7..44a8afcf 100644
--- a/execute_cmd.c
+++ b/execute_cmd.c
@@ -4735,7 +4735,6 @@ execute_builtin_or_function (words, builtin, var, redirects,
char *ofifo_list;
#endif
-
#if defined (PROCESS_SUBSTITUTION)
ofifo = num_fifos ();
ofifo_list = copy_fifo_list (&osize);
@@ -5219,6 +5218,8 @@ shell_execve (command, args, env)
Maybe it is something we can hack ourselves. */
if (i != ENOEXEC)
{
+ /* make sure this is set correctly for file_error/report_error */
+ last_command_exit_value = (i == ENOENT) ? EX_NOTFOUND : EX_NOEXEC; /* XXX Posix.2 says that exit status is 126 */
if (file_isdir (command))
#if defined (EISDIR)
internal_error (_("%s: %s"), command, strerror (EISDIR));
@@ -5266,7 +5267,7 @@ shell_execve (command, args, env)
errno = i;
file_error (command);
}
- return ((i == ENOENT) ? EX_NOTFOUND : EX_NOEXEC); /* XXX Posix.2 says that exit status is 126 */
+ return (last_command_exit_value);
}
/* This file is executable.
diff --git a/lib/readline/input.c b/lib/readline/input.c
index 59875914..0e5b90e6 100644
--- a/lib/readline/input.c
+++ b/lib/readline/input.c
@@ -525,7 +525,7 @@ rl_getc (stream)
#undef X_EWOULDBLOCK
#undef X_EAGAIN
-fprintf(stderr, "rl_getc: result = %d errno = %d\n", result, errno);
+/* fprintf(stderr, "rl_getc: result = %d errno = %d\n", result, errno); */
/* If the error that we received was EINTR, then try again,
this is simply an interrupted system call to read (). We allow
diff --git a/patchlevel.h b/patchlevel.h
index b7c2ff4c..d669696c 100644
--- a/patchlevel.h
+++ b/patchlevel.h
@@ -25,6 +25,6 @@
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
looks for to find the patch level (for the sccs version string). */
-#define PATCHLEVEL 11
+#define PATCHLEVEL 18
#endif /* _PATCHLEVEL_H_ */