when they are expanded in a context that will not perform word
splitting
Report by Emanuele Torre <torreemanuele6@gmail.com>
+
+execute_cmd.c
+ - time_command: make sure to initialize CODE in the posix and null
+ command case so we don't longjmp to nowhere
+ Report and patch from Grisha Levit <grishalevit@gmail.com>
+
+pathexp.c
+ - globsort_sortarray: if the sort type is unknown, default sortfunc
+ to globsort_namecmp
+
+error.h
+ - programming_error: add `noreturn' attribute
+
+ 11/25
+ -----
+variables.c
+ - get_bash_name: use sh_realpath instead of sh_canonpath; less code
+ Modification of change from 11/18
+
+ 12/1
+ ----
+trap.c, trap.h
+ - clear_exit_trap: new function to unset the exit trap and clear out
+ the trap string
+
+execute_cmd.c
+ - execute_in_subshell: clear the exit trap before checking for a
+ pending fatal signal
+ From https://savannah.gnu.org/bugs/?67745
#define SKIP1 "#'-+ 0"
#define LENMODS "hjlLtz"
+#define DIGITS "0123456789"
#ifndef TIMELEN_MAX
# define TIMELEN_MAX 128
static char **narg_argv;
static int narg_argc;
static int narg_maxind;
-static int narg_curind;
static intmax_t tw;
A backslash.
@item \[
Begin a sequence of non-printing characters.
-Thiss could be used to
+This could be used to
embed a terminal control sequence into the prompt.
@item \]
End a sequence of non-printing characters.
extern void file_error (const char *);
/* Report a programmer's error, and abort. Pass REASON, and ARG1 ... ARG5. */
-extern void programming_error (const char *, ...) __attribute__((__format__ (printf, 1, 2)));
+extern void programming_error (const char *, ...) __attribute__((__format__ (printf, 1, 2))) __attribute__((__noreturn__));;
/* General error reporting. Pass FORMAT and ARG1 ... ARG5. */
extern void report_error (const char *, ...) __attribute__((__format__ (printf, 1, 2)));
rsf = usf = ssf = 0;
cpu = 0;
+ code = 0;
+
old_subshell = subshell_environment;
posix_time = command && (command->flags & CMD_TIME_POSIX);
nullcmd = (command == 0) || (command->type == cm_simple && command->value.Simple->words == 0 && command->value.Simple->redirects == 0);
subshell_environment |= SUBSHELL_COPROC;
}
+ /* clear the exit trap before checking for fatal signals */
+ clear_exit_trap ();
+
QUIT;
CHECK_TERMSIG;
break;
forksleep <<= 1;
- if (interrupt_state)
+ if (interrupt_state) /* XXX - and terminating_signal? */
break;
sigprocmask (SIG_SETMASK, &set, (sigset_t *)NULL);
}
break;
default:
internal_error (_("invalid glob sort type"));
+ sortfunc = (QSFUNC *)globsort_namecmp;
break;
}
/* trap.c -- Not the trap command, but useful functions for manipulating
those objects. The trap command is in builtins/trap.def. */
-/* Copyright (C) 1987-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2025 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
sigmodes[sig] &= ~(SIG_INPROGRESS|SIG_CHANGED);
}
+void
+clear_exit_trap ()
+{
+ if (sigmodes[EXIT_TRAP] & SIG_TRAPPED)
+ {
+ sigmodes[EXIT_TRAP] &= ~SIG_TRAPPED; /* XXX - SIG_INPROGRESS? */
+ free_trap_command (EXIT_TRAP);
+ trap_list[EXIT_TRAP] = (char *)NULL;
+ }
+
+}
+
#define RECURSIVE_SIG(s) (SPECIAL_TRAP(s) == 0)
/* Run a trap command for SIG. SIG is one of the signals the shell treats
/* trap.h -- data structures used in the trap mechanism. */
-/* Copyright (C) 1993-2023 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2025 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
extern void restore_default_signal (int);
extern void ignore_signal (int);
+
+extern void clear_exit_trap (void);
extern int run_exit_trap (void);
extern void run_trap_cleanup (int);
extern int run_debug_trap (void);
tname = make_absolute (shell_name, get_string_value ("PWD"));
if (*shell_name == '.')
{
- char *x, *fp;
-
- x = strrchr (tname, '/');
- *x = 0;
- name = sh_canonpath (tname, PATH_CHECKDOTDOT|PATH_CHECKEXISTS);
- *x++ = '/';
+ name = sh_realpath (tname, 0);
if (name == 0)
name = tname;
else
- {
- fp = sh_makepath (name, x, 0);
- free (tname);
- if (fp)
- {
- free (name);
- name = fp;
- }
- }
+ free (tname);
}
else
name = tname;