lib/readline/misc.c
- rl_digit_argument: call _rl_del_executing_keyseq after rl_execute_next
+
+ 11/3
+ ----
+builtins/setattr.def
+ - show_localname_attributes: special-case "-" local variable, since
+ there is no `declare -' equivalent.
+ Reported by Emanuele Torre <torreemanuele6@gmail.com>.
+
+ 11/4
+ ----
+lib/sh/tmpfile.c
+ - sh_mktmpname,sh_mktmpfd: use get_urandom32() instead of random() if
+ we're not using mktemp or mkstemp and the system provides the
+ appropriate support
+
+trap.c
+ - trap_variable_context: new variable, set to variable_context every
+ time a trap string runs (that is, every time running_trap is set to
+ a value > 0) in _run_trap_internal, run_exit_trap, run_pending_traps
+
+trap.h
+ - trap_variable_context: extern declaration
+
+builtins/common.c
+ - get_exitstat: if the `return' builtin is running, we are running a
+ trap (but not the DEBUG trap), and the return would cause the trap
+ string to complete (variable_context == trap_variable_context, so
+ we haven't executed another shell function), use the last command
+ exit value as the return status. POSIX interp 1602, from
+ https://www.austingroupbugs.net/view.php?id=1602
+
+ 11/4
+ ----
+
+lib/readline/display.c
+ - local_prompt_invis_chars: new array variable, similar to
+ local_prompt_newlines, that keeps track of the number of invisible
+ characters on each line of the prompt string. Use in WRAP_OFFSET
+ macro with eye to using in W_OFFSET as well. Used for the case where
+ the last line of the prompt is not the last line with invisible
+ characters. Can use this in more calculations replacing wrap_offset
+ and prompt_invis_chars_first_line going forward. Inspired by report
+ from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1018851
+ - update_line: use local_prompt_invis_chars to set _rl_last_c_pos
+ correctly when on a non-terminal prompt line that contains
+ invisible characters
provide a stack trace.\n\
\n\
The value of EXPR indicates how many call frames to go back before the\n\
- current one; the top frame is frame 0."),
+ current one; the top frame is frame 0.\n\
+ \n\
+ Exit Status:\n\
+ Returns 0 unless the shell is not executing a shell function or EXPR\n\
+ is invalid."
+),
(char *)NULL
};
if (list == 0)
{
- /* If we're not running the DEBUG trap, the return builtin, when not
- given any arguments, uses the value of $? before the trap ran. If
- given an argument, return uses it. This means that the trap can't
- change $?. The DEBUG trap gets to change $?, though, since that is
- part of its reason for existing, and because the extended debug mode
- does things with the return value. */
- if (this_shell_builtin == return_builtin && running_trap > 0 && running_trap != DEBUG_TRAP+1)
+ /* If we're not running the DEBUG trap, and haven't executed a shell
+ function from the trap action, the return builtin, when not given
+ any arguments, uses the value of $? before the trap ran. The business
+ about executing a shell function from the trap action is from POSIX
+ interp 1602 (10/2022). If given an argument, return uses it
+ unconditionally. This means that the trap can't change $?. The DEBUG
+ trap gets to change $?, though, since that is part of its reason for
+ existing, and because the extended debug mode does things with the
+ return value. */
+ if (this_shell_builtin == return_builtin && running_trap > 0 && running_trap != DEBUG_TRAP+1 && variable_context == trap_variable_context)
return (trap_saved_exit_value);
return (last_command_exit_value);
}
#include "../flags.h"
#include "common.h"
#include "bashgetopt.h"
+#include "builtext.h"
extern sh_builtin_func_t *this_shell_builtin;
-#ifdef ARRAY_VARS
-extern int declare_builtin PARAMS((WORD_LIST *));
-#endif
-
#define READONLY_OR_EXPORT \
(this_shell_builtin == readonly_builtin || this_shell_builtin == export_builtin)
+#define SPECIAL_LOCAL(n) \
+ (this_shell_builtin == local_builtin && n[0] == '-' && n[1] == 0)
+
$BUILTIN export
$FUNCTION export_builtin
$SHORT_DOC export [-fn] [name[=value] ...] or export -p
if (var && local_p (var) && var->context == variable_context) /* show every variable with attributes, even unset ones */
{
- show_var_attributes (var, READONLY_OR_EXPORT, nodefs);
+ /* There is no equivalent `declare -'. */
+ if (STREQ (var->name, "-"))
+ printf ("local -\n");
+ else
+ show_var_attributes (var, READONLY_OR_EXPORT, nodefs);
return (0);
}
else
dispose_redirects (command->redirects);
command->redirects = (REDIRECT *)NULL;
#if 0
- /* TAG: bash-5.3 kre 10/24/2022 */
#if defined (PROCESS_SUBSTITUTION) && defined (JOB_CONTROL)
+ /* TAG: bash-5.3 kre 10/24/2022 */
if (user_subshell && command->type == cm_subshell)
{
procsub_clear ();
}
#endif
#endif
- }
+ }
if (command->type == cm_subshell)
tcom = command->value.Subshell->command;
procsub_waitpid (last_procsub_child->pid);
reap_procsubs (); /* closes fd */
#endif
-
+
/* POSIX.2 says the shell can discard the statuses of all completed jobs if
`wait' is called with no arguments. */
mark_dead_jobs_as_notified (1);
characters in the prompt or use heuristics about where they are. */
static int *local_prompt_newlines;
+/* An array saying how many invisible characters are in each line of the
+ prompt. */
+static int *local_prompt_invis_chars;
+
/* set to a non-zero value by rl_redisplay if we are marking modified history
lines and the current line is so marked. */
static int modmark;
static char *saved_local_prompt;
static char *saved_local_prefix;
static int *saved_local_prompt_newlines;
+static int *saved_local_prompt_invis_chars;
static int saved_last_invisible;
static int saved_visible_length;
{
char *r, *ret, *p, *igstart, *nprompt, *ms;
int l, rl, last, ignoring, ninvis, invfl, invflset, ind, pind, physchars;
- int mlen, newlines, newlines_guess, bound, can_add_invis;
+ int mlen, newlines, newlines_guess, bound, can_add_invis, lastinvis;
int mb_cur_max;
/* We only expand the mode string for the last line of a multiline prompt
*vlp = l;
local_prompt_newlines = (int *) xrealloc (local_prompt_newlines, sizeof (int) * 2);
- local_prompt_newlines[0] = 0;
+ local_prompt_invis_chars = (int *) xrealloc (local_prompt_invis_chars, sizeof (int) * 2);
+ local_prompt_newlines[0] = local_prompt_invis_chars[0] = 0;
local_prompt_newlines[1] = -1;
return r;
newlines_guess = (_rl_screenwidth > 0) ? APPROX_DIV(l, _rl_screenwidth) : APPROX_DIV(l, 80);
local_prompt_newlines = (int *) xrealloc (local_prompt_newlines, sizeof (int) * (newlines_guess + 1));
local_prompt_newlines[newlines = 0] = 0;
+ local_prompt_invis_chars = (int *) xrealloc (local_prompt_invis_chars, sizeof (int) * (newlines_guess + 1));
+ local_prompt_invis_chars[0] = 0;
for (rl = 1; rl <= newlines_guess; rl++)
- local_prompt_newlines[rl] = -1;
+ {
+ local_prompt_newlines[rl] = -1;
+ local_prompt_invis_chars[rl] = 0;
+ }
rl = physchars = 0; /* mode string now part of nprompt */
invfl = 0; /* invisible chars in first line of prompt */
invflset = 0; /* we only want to set invfl once */
igstart = 0; /* we're not ignoring any characters yet */
- for (ignoring = last = ninvis = 0, p = nprompt; p && *p; p++)
+ for (ignoring = last = ninvis = lastinvis = 0, p = nprompt; p && *p; p++)
{
/* This code strips the invisible character string markers
RL_PROMPT_START_IGNORE and RL_PROMPT_END_IGNORE */
counter. */
if (invflset && newlines == 1)
invfl = ninvis;
+ local_prompt_invis_chars[newlines - 1] = ninvis - lastinvis;
+ lastinvis = ninvis;
}
if (p != (igstart + 1))
last = r - ret - 1;
else
new = r - ret;
local_prompt_newlines[++newlines] = new;
+ local_prompt_invis_chars[newlines - 1] = ninvis - lastinvis;
+ lastinvis = ninvis;
}
/* What if a physical character of width >= 2 is split? There is
if (rl <= _rl_screenwidth)
invfl = ninvis;
+ /* Make sure we account for invisible characters on the last line. */
+ local_prompt_invis_chars[newlines] = ninvis - lastinvis;
+
*r = '\0';
if (lp)
*lp = rl;
in the first physical line of the prompt.
wrap_offset - prompt_invis_chars_first_line is usually the number of
invis chars on the second (or, more generally, last) line. */
+ /* XXX - There is code that assumes that all the invisible characters occur
+ on the first and last prompt lines; change that to use
+ local_prompt_invis_chars */
/* This is zero-based, used to set the newlines */
prompt_lines_estimate = lpos / _rl_screenwidth;
}
/* Now set lpos from the last newline */
+ /* XXX - change to use local_prompt_invis_chars[] */
if (mb_cur_max > 1 && rl_byte_oriented == 0 && prompt_multibyte_chars > 0)
lpos = _rl_col_width (local_prompt, temp, local_prompt_len, 1) - (wrap_offset - prompt_invis_chars_first_line);
else
second and subsequent lines start at inv_lbreaks[N], offset by
OFFSET (which has already been calculated above). */
-#define INVIS_FIRST() (prompt_physical_chars > _rl_screenwidth ? prompt_invis_chars_first_line : wrap_offset)
-#define WRAP_OFFSET(line, offset) ((line == 0) \
- ? (offset ? INVIS_FIRST() : 0) \
- : ((line == prompt_last_screen_line) ? wrap_offset-prompt_invis_chars_first_line : 0))
+#define INVIS_FIRST() (local_prompt_invis_chars[0])
+#define WRAP_OFFSET(line, offset) ((line <= prompt_last_screen_line) ? local_prompt_invis_chars[line] : 0)
+
#define W_OFFSET(line, offset) ((line) == 0 ? offset : 0)
#define VIS_LLEN(l) ((l) > _rl_vis_botlin ? 0 : (vis_lbreaks[l+1] - vis_lbreaks[l]))
#define INV_LLEN(l) (inv_lbreaks[l+1] - inv_lbreaks[l])
#define INV_LINE(line) (invisible_line + inv_lbreaks[line])
#define INV_LINE_FACE(line) (inv_face + inv_lbreaks[line])
+#define INV_CHARS_CURRENT_PROMPT_LINE(line) \
+ (local_prompt_invis_chars[line] > 0)
+
#define OLD_CPOS_IN_PROMPT() (cpos_adjusted == 0 && \
_rl_last_c_pos != o_cpos && \
_rl_last_c_pos > wrap_offset && \
between the first and last lines of the prompt, if the
prompt consumes more than two lines. It's usually right */
/* XXX - not sure this is ever executed */
+ /* XXX - use local_prompt_invis_chars[linenum] */
_rl_last_c_pos -= (wrap_offset-prompt_invis_chars_first_line);
/* If this is the line with the prompt, we might need to
only need to reprint it if the cursor is before the last
invisible character in the prompt string. */
/* XXX - why not use local_prompt_len? */
+ /* XXX - This is right only if the prompt is a single line. */
nleft = prompt_visible_length + wrap_offset;
if (cursor_linenum == 0 && wrap_offset > 0 && _rl_last_c_pos > 0 &&
_rl_last_c_pos < PROMPT_ENDING_INDEX && local_prompt)
/* See comments at dumb_update: for an explanation of this heuristic */
if (nmax < omax)
goto clear_rest_of_line;
+ /* XXX - need to use WRAP_OFFSET(current_line, wrap_offset) instead of
+ W_OFFSET - XXX */
else if ((nmax - W_OFFSET(current_line, wrap_offset)) < (omax - W_OFFSET (current_line, visible_wrap_offset)))
goto clear_rest_of_line;
else
}
/* count of invisible characters in the current invisible line. */
- current_invis_chars = W_OFFSET (current_line, wrap_offset);
+ current_invis_chars = WRAP_OFFSET (current_line, wrap_offset);
if (_rl_last_v_pos != current_line)
{
_rl_move_vert (current_line);
else
/* We take wrap_offset into account here so we can pass correct
information to _rl_move_cursor_relative. */
+ /* XXX - can use local_prompt_invis_chars[0] instead of wrap_offset */
_rl_last_c_pos = _rl_col_width (local_prompt, 0, lendiff, 1) - wrap_offset + modmark;
cpos_adjusted = 1;
}
wrap_offset-prompt_invis_chars_first_line
on the assumption that this is the number of invisible
characters in the last line of the prompt. */
+ /* XXX - CHANGE THIS USING local_prompt_invis_chars[current_line] */
if (wrap_offset > prompt_invis_chars_first_line &&
current_line == prompt_last_screen_line &&
prompt_physical_chars > _rl_screenwidth &&
wrap_offset >= prompt_invis_chars_first_line &&
_rl_horizontal_scroll_mode == 0)
ADJUST_CPOS (prompt_invis_chars_first_line);
+ /* XXX - This is experimental. It's a start at supporting
+ prompts where a non-terminal line contains the last
+ invisible characters. We assume that we can use the
+ local_prompt_invis_chars array and that the current line
+ is completely filled with characters to _rl_screenwidth,
+ so we can either adjust by the number of bytes in the
+ current line or just go straight to _rl_screenwidth */
+ else if (current_line > 0 && current_line < prompt_last_screen_line &&
+ INV_CHARS_CURRENT_PROMPT_LINE(current_line) &&
+ _rl_horizontal_scroll_mode == 0)
+ {
+ _rl_last_c_pos = _rl_screenwidth;
+ cpos_adjusted = 1;
+ }
}
else
_rl_last_c_pos += temp;
know for sure, so we use another heuristic calclulation below. */
if (nmax < omax)
goto clear_rest_of_line; /* XXX */
+ /* XXX - use WRAP_OFFSET(current_line, wrap_offset) here instead of
+ W_OFFSET since current_line == 0 */
else if ((nmax - W_OFFSET(current_line, wrap_offset)) < (omax - W_OFFSET (current_line, visible_wrap_offset)))
goto clear_rest_of_line;
else
saved_invis_chars_first_line = prompt_invis_chars_first_line;
saved_physical_chars = prompt_physical_chars;
saved_local_prompt_newlines = local_prompt_newlines;
+ saved_local_prompt_invis_chars = local_prompt_invis_chars;
local_prompt = local_prompt_prefix = (char *)0;
local_prompt_len = 0;
local_prompt_newlines = (int *)0;
+ local_prompt_invis_chars = (int *)0;
prompt_last_invisible = prompt_visible_length = prompt_prefix_length = 0;
prompt_invis_chars_first_line = prompt_physical_chars = 0;
FREE (local_prompt);
FREE (local_prompt_prefix);
FREE (local_prompt_newlines);
+ FREE (local_prompt_invis_chars);
local_prompt = saved_local_prompt;
local_prompt_prefix = saved_local_prefix;
local_prompt_len = saved_local_length;
local_prompt_newlines = saved_local_prompt_newlines;
+ local_prompt_invis_chars = saved_local_prompt_invis_chars;
prompt_prefix_length = saved_prefix_length;
prompt_last_invisible = saved_last_invisible;
saved_local_length = 0;
saved_last_invisible = saved_visible_length = saved_prefix_length = 0;
saved_invis_chars_first_line = saved_physical_chars = 0;
- saved_local_prompt_newlines = 0;
+ saved_local_prompt_newlines = saved_local_prompt_invis_chars = 0;
}
char *
extern int errno;
#endif
+#if defined (HAVE_GETRANDOM) || defined (HAVE_ARC4RANDOM) || defined (HAVE_GETENTROPY)
+# define USE_URANDOM32
+#endif
+
#define BASEOPENFLAGS (O_CREAT | O_TRUNC | O_EXCL | O_BINARY)
#define DEFAULT_TMPDIR "." /* bogus default, should be changed */
filename = NULL;
}
#else /* !USE_MKTEMP */
+#ifndef USE_URANDOM32
sh_seedrand ();
+#endif
while (1)
{
+ unsigned long x;
+#ifdef USE_URANDOM32
+ x = (unsigned long) ((flags & MT_USERANDOM) ? get_urandom32 () : ntmpfiles++);
+#else
+ x = (unsigned long) ((flags & MT_USERANDOM) ? random () : ntmpfiles++);
+#endif
filenum = (filenum << 1) ^
(unsigned long) time ((time_t *)0) ^
(unsigned long) dollar_dollar_pid ^
- (unsigned long) ((flags & MT_USERANDOM) ? random () : ntmpfiles++);
+ x;
sprintf (filename, "%s/%s-%lu", tdir, lroot, filenum);
if (tmpnamelen > 0 && tmpnamelen < 32)
filename[tdlen + 1 + tmpnamelen] = '\0';
*namep = filename;
return fd;
#else /* !USE_MKSTEMP */
+#ifndef USE_URANDOM32
sh_seedrand ();
+#endif
do
{
+ unsigned long x;
+#ifdef USE_URANDOM32
+ x = (unsigned long) ((flags & MT_USERANDOM) ? get_urandom32 () : ntmpfiles++);
+#else
+ x = (unsigned long) ((flags & MT_USERANDOM) ? random () : ntmpfiles++);
+#endif
filenum = (filenum << 1) ^
(unsigned long) time ((time_t *)0) ^
(unsigned long) dollar_dollar_pid ^
- (unsigned long) ((flags & MT_USERANDOM) ? random () : ntmpfiles++);
+ x;
sprintf (filename, "%s/%s-%lu", tdir, lroot, filenum);
if (tmpnamelen > 0 && tmpnamelen < 32)
filename[tdlen + 1 + tmpnamelen] = '\0';
#: builtins/common.c:244 expr.c:1574
msgid "invalid number"
-msgstr "nevaljan broj"
+msgstr "nevaljani broj"
#: builtins/common.c:252
#, c-format
#: builtins/common.c:708 builtins/common.c:710
#, c-format
msgid "%s: ambiguous job spec"
-msgstr "%s: oznaka posla nije jednoznačna"
+msgstr "%s: dvosmislena oznaka posla"
#: builtins/common.c:971
msgid "help not available in this version"
#: builtins/getopt.c:110
#, c-format
msgid "%s: illegal option -- %c\n"
-msgstr "%s: neispravna opcija -- %c\n"
+msgstr "%s: nelegalna opcija -- %c\n"
#: builtins/getopt.c:111
#, c-format
#: error.c:489
msgid "bad command type"
-msgstr "loša vrsta naredbe"
+msgstr "loš tip naredbe"
#: error.c:490
msgid "bad connector"
#: expr.c:478
msgid "syntax error in expression"
-msgstr "sintaktička greška u izrazu"
+msgstr "sintaktična greška u izrazu"
#: expr.c:522
msgid "attempted assignment to non-variable"
#: expr.c:531
msgid "syntax error in variable assignment"
-msgstr "sintaktička greška u dodjeljivanju varijabli"
+msgstr "sintaktična greška u dodjeljivanju varijabli"
#: expr.c:545 expr.c:912
msgid "division by 0"
#: expr.c:1108 expr.c:1492
msgid "syntax error: operand expected"
-msgstr "sintaktička greška: očekivan je operand"
+msgstr "sintaktična greška: očekivan je operand"
#: expr.c:1494
msgid "syntax error: invalid arithmetic operator"
-msgstr "sintaktička greška: nevaljan aritmetički operator"
+msgstr "sintaktična greška: nevaljan aritmetički operator"
#: expr.c:1518
#, c-format
#: jobs.c:1990
#, c-format
msgid "(core dumped) "
-msgstr "(snimka (core dump) memorije je spremljena!) "
+msgstr "(ispis memorije je spremljen!) "
#: jobs.c:2009
#, c-format
#: jobs.c:4321 nojobs.c:921
#, c-format
msgid " (core dumped)"
-msgstr " (snimka (core dump) memorije je spremljena!)"
+msgstr " (ispis memorije je spremljen!)"
#: jobs.c:4333 jobs.c:4346
#, c-format
#: make_cmd.c:314
msgid "syntax error: arithmetic expression required"
-msgstr "sintaktička greška: nužan je aritmetički izraz"
+msgstr "sintaktična greška: nužan je aritmetički izraz"
#: make_cmd.c:316
msgid "syntax error: `;' unexpected"
-msgstr "sintaktička greška: neočekivan „;“ znak"
+msgstr "sintaktična greška: neočekivan „;“ znak"
#: make_cmd.c:317
#, c-format
msgid "syntax error: `((%s))'"
-msgstr "sintaktička greška: „((%s))“"
+msgstr "sintaktična greška: „((%s))“"
#: make_cmd.c:569
#, c-format
msgid "make_here_document: bad instruction type %d"
-msgstr "make_here_document(): loša vrsta instrukcije %d"
+msgstr "make_here_document(): loš tip instrukcije %d"
#: make_cmd.c:668
#, c-format
#: parse.y:4457
#, c-format
msgid "syntax error in conditional expression: unexpected token `%s'"
-msgstr "sintaktička greška u uvjetnom izrazu: neočekivan simbol „%s“"
+msgstr "sintaktična greška u uvjetnom izrazu: neočekivan simbol „%s“"
#: parse.y:4461
msgid "syntax error in conditional expression"
-msgstr "sintaktička greška u uvjetnom izrazu"
+msgstr "sintaktična greška u uvjetnom izrazu"
#: parse.y:4539
#, c-format
#: parse.y:6118
#, c-format
msgid "syntax error near unexpected token `%s'"
-msgstr "sintaktička greška blizu neočekivanog simbola „%s“"
+msgstr "sintaktična greška blizu neočekivanog simbola „%s“"
#: parse.y:6137
#, c-format
msgid "syntax error near `%s'"
-msgstr "sintaktička greška blizu „%s“"
+msgstr "sintaktična greška blizu „%s“"
#: parse.y:6151
msgid "syntax error: unexpected end of file"
-msgstr "sintaktička greška: neočekivani kraj datoteke"
+msgstr "sintaktična greška: neočekivani kraj datoteke"
#: parse.y:6151
msgid "syntax error"
-msgstr "sintaktička greška"
+msgstr "sintaktična greška"
#: parse.y:6216
#, c-format
#: redir.c:205
#, c-format
msgid "%s: ambiguous redirect"
-msgstr "%s: preusmjeravanje nije jednoznačno"
+msgstr "%s: dvosmisleno preusmjeravanje"
#: redir.c:209
#, c-format
#: shell.c:1658
#, c-format
msgid "%s: Is a directory"
-msgstr "%s: to je direktorij"
+msgstr "%s: Je direktorij"
#: shell.c:1907
msgid "I have no name!"
#: siglist.c:63
msgid "Illegal instruction"
-msgstr "Nedopuštena instrukcija"
+msgstr "nelegalna instrukcija"
#: siglist.c:67
msgid "BPT trace/trap"
#: siglist.c:99
msgid "Bad system call"
-msgstr "Loš sustavski poziv"
+msgstr "Loš sustavni poziv"
#: siglist.c:103
msgid "Broken pipe"
#: siglist.c:167
msgid "Window changed"
-msgstr "Prozor je promijenjen"
+msgstr "Prozor promijenjen"
#: siglist.c:171
msgid "Record lock"
#: siglist.c:215
msgid "Information request"
-msgstr "Zahtjev za obavijestima"
+msgstr "Zahtjev za informacijama"
#: siglist.c:223 siglist.c:225
#, c-format
#: test.c:914
#, c-format
msgid "syntax error: `%s' unexpected"
-msgstr "sintaktička greška: neočekivan „%s“"
+msgstr "sintaktična greška: neočekivan „%s“"
#: trap.c:220
msgid "invalid signal number"
#: variables.c:2818 variables.c:2874
#, c-format
msgid "%s: cannot inherit value from incompatible type"
-msgstr "%s: nije moguće naslijediti vrijednost od nekompatibilne vrste"
+msgstr "%s: nije moguće naslijediti vrijednost nekompatibilnog tipa"
#: variables.c:3459
#, c-format
" Opcije:\n"
" -p rabi zadanu vrijednost za PATH kao garanciju\n"
" pronalaženja svih standardnih programa\n"
-" -v pokaže ime naredbe koja bi se izvršila\n"
-" -V == „-v” ali opširnije\n"
+" -v pokaže ime naredbe koja bi se izvršila similar to the „type“ builtin\n"
+" -V == kao „-v” ali opširnije\n"
"\n"
" Završi s izlaznim kȏdom NAREDBE\n"
" ili s 1 ako NAREDBA nije pronađena."
" Exit Status:\n"
" Returns success if all of the NAMEs are found; fails if any are not found."
msgstr ""
-"Prikaže informacije o vrsti naredbe.\n"
+"Prikaže informacije o tipu naredbe.\n"
"\n"
" Pokaže, kako bi se interpretiralo svako dano IME kad bi se IME koristilo\n"
" kao naredba.\n"
" HISTSIZE maksimalni broj redaka koje trenutna ljuska može dosegnuti\n"
" HOME puni naziv staze do vašega vlastitog direktorija\n"
" HOSTNAME ime računala na kojem se izvršava „bash“\n"
-" HOSTTYPE vrsta CPU-a na kojem se izvršava „bash“\n"
+" HOSTTYPE tip CPU-a na kojem se izvršava „bash“\n"
" IGNOREEOF broj zanemarenih Ctrl-D (EOF) prije zatvaranja ljuske\n"
" MACHTYPE vrsta računala na kojem se izvršava „bash“\n"
" MAILCHECK kako često (u sekundama) „bash“ gleda ima li nove pošte\n"
" PS2 string koji opisuje sekundarni prompt (zadano, „>“)\n"
" PWD puni naziv staze trenutnog radnog direktorija\n"
" SHELLOPTS popis svih omogućenih opcija ljuske\n"
-" TERM naziv vrste trenutnog terminala\n"
+" TERM naziv tipa trenutnog terminala\n"
" TIMEFORMAT pravilo za format ispisa „time“ statistika\n"
" auto_resume ako nije prazan, učini da se naredbena riječ na naredbenom\n"
" retku prvo potraži na popisu zaustavljenih poslova,\n"
{
tlist = quote_list (list);
word_list_remove_quoted_nulls (tlist);
+#if 0
ret = string_list (tlist);
+#else
+ /* TAG:bash-5.3 Aloxaf Yin 9/1/2022 */
+ ret = string_list_dollar_star (tlist, 0, 0);
+#endif
}
else if (pchar == '*' && quoted == 0 && ifs_is_null) /* XXX */
ret = expand_no_split_dollar_star ? string_list_dollar_star (list, quoted, 0) : string_list_dollar_at (list, quoted, 0); /* Posix interp 888 */
quote the whole string, including the separators. If IFS
is unset, the parameters are separated by ' '; if $IFS is
null, the parameters are concatenated. */
+#if 0
temp = (quoted & (Q_DOUBLE_QUOTES|Q_PATQUOTE)) ? string_list_dollar_star (list, quoted, 0) : string_list (list);
+#else
+ /* TAG:bash-5.3 Aloxaf Yin 9/1/2022 */
+ temp = string_list_dollar_star (list, quoted, 0);
+#endif
if (temp)
{
temp1 = (quoted & Q_DOUBLE_QUOTES) ? quote_string (temp) : temp;
echo after 2
unset -f fn
+
+# since this sets the exit trap, it has to go last
+
+set +o functrace
+# posix interp 1602
+ReturnFalse()
+{
+ false ; return
+}
+
+trap 'ReturnFalse && echo "woops"' EXIT
trap command (e.g., when `return' is executed in the trap command). */
int running_trap;
+/* The variable context (function execution level) when we began running
+ this trap command. */
+int trap_variable_context;
+
/* Set to last_command_exit_value before running a trap. */
int trap_saved_exit_value;
{
register int sig;
int x;
- volatile int old_exit_value, old_running;
+ volatile int old_exit_value, old_running, old_context;
WORD_LIST *save_subst_varlist;
HASH_TABLE *save_tempenv;
sh_parser_state_t pstate;
ps = save_pipestatus_array ();
#endif
old_running = running_trap;
+ old_context = trap_variable_context;
for (sig = 1; sig < NSIG; sig++)
{
{
/* XXX - set last_command_exit_value = trap_saved_exit_value here? */
running_trap = sig + 1;
+ trap_variable_context = variable_context;
if (sig == SIGINT)
{
if (function_code)
{
running_trap = old_running; /* XXX */
+ trap_variable_context = old_context;
/* caller will set last_command_exit_value */
sh_longjmp (return_catch, 1);
}
pending_traps[sig] = 0; /* XXX - move before evalstring? */
running_trap = old_running;
+ trap_variable_context = old_context;
}
}
retval = trap_saved_exit_value;
running_trap = 1;
+ trap_variable_context = variable_context;
code = setjmp_nosigs (top_level);
char *trap_command, *old_trap;
int trap_exit_value;
volatile int save_return_catch_flag, function_code;
- int old_modes, old_running, old_int;
+ int old_modes, old_running, old_int, old_context;
int flags;
procenv_t save_return_catch;
WORD_LIST *save_subst_varlist;
ARRAY *ps;
#endif
- old_modes = old_running = -1;
+ old_modes = old_running = old_context = -1;
trap_exit_value = function_code = 0;
trap_saved_exit_value = last_command_exit_value;
old_trap = trap_list[sig];
old_modes = sigmodes[sig];
old_running = running_trap;
+ old_context = trap_variable_context;
sigmodes[sig] |= SIG_INPROGRESS;
sigmodes[sig] &= ~SIG_CHANGED; /* just to be sure */
trap_command = savestring (old_trap);
running_trap = sig + 1;
+ trap_variable_context = variable_context;
old_int = interrupt_state; /* temporarily suppress pending interrupts */
CLRINTERRUPT;
running_trap = old_running;
interrupt_state = old_int;
+ trap_variable_context = old_context;
if (sigmodes[sig] & SIG_CHANGED)
{
extern int trapped_signal_received;
extern int wait_signal_received;
extern int running_trap;
+extern int trap_variable_context;
extern int trap_saved_exit_value;
extern int suppress_debug_trap_verbose;