fix for line numbers for nested function declarations; fix execve error for ENOENT

This commit is contained in:
Chet Ramey
2022-10-11 16:17:22 -04:00
parent 22f21b760e
commit 55a8311420
6 changed files with 42 additions and 12 deletions
+11 -7
View File
@@ -5983,11 +5983,6 @@ shell_execve (command, args, env)
errno = i;
file_error (command);
}
else if (i == ENOENT)
{
errno = i;
internal_error (_("%s: cannot execute: required file not found"), command);
}
else
{
/* The file has the execute bits set, but the kernel refuses to
@@ -6015,9 +6010,18 @@ shell_execve (command, args, env)
FREE (interp);
return (EX_NOEXEC);
}
else
#endif
errno = i;
file_error (command);
if (i == ENOENT)
{
errno = i;
internal_error (_("%s: cannot execute: required file not found"), command);
}
else
{
errno = i;
file_error (command);
}
}
return (last_command_exit_value);
}