mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-03 02:10:50 +02:00
do not require leading . for rl color prefix etension; fix for isearch in single-byte locales; next set of doc updates (SIGNALS); add warning for invalid job id; allow function names to be non-identifiers in posix mode
This commit is contained in:
@@ -272,6 +272,13 @@ sh_nojobs (const char *s)
|
||||
else
|
||||
builtin_error (_("no job control"));
|
||||
}
|
||||
|
||||
void
|
||||
sh_invalidjob (const char *s)
|
||||
{
|
||||
builtin_error (_("%s: invalid job specification"), s);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if defined (RESTRICTED_SHELL)
|
||||
@@ -693,6 +700,14 @@ get_job_spec (WORD_LIST *list)
|
||||
|
||||
if (*word == '%')
|
||||
word++;
|
||||
else
|
||||
#if 1
|
||||
/* This could be builtin_error or sh_invalidjob() */
|
||||
builtin_warning (_("%s: job specification requires leading `%%'"), word);
|
||||
#else
|
||||
/* TAG:bash-5.4 10/23/2024 */
|
||||
return (BAD_JOBSPEC);
|
||||
#endif
|
||||
|
||||
if (DIGIT (*word) && all_digits (word))
|
||||
{
|
||||
|
||||
@@ -103,6 +103,7 @@ extern void sh_erange (const char *, const char *);
|
||||
extern void sh_badpid (const char *);
|
||||
extern void sh_badjob (const char *);
|
||||
extern void sh_nojobs (const char *);
|
||||
extern void sh_invalidjob (const char *);
|
||||
extern void sh_restricted (const char *);
|
||||
extern void sh_notbuiltin (const char *);
|
||||
extern void sh_wrerror (void);
|
||||
|
||||
+4
-2
@@ -1,7 +1,7 @@
|
||||
This file is fg_bg.def, from which is created fg_bg.c.
|
||||
It implements the builtins "bg" and "fg" in Bash.
|
||||
|
||||
Copyright (C) 1987-2022 Free Software Foundation, Inc.
|
||||
Copyright (C) 1987-2024 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
@@ -144,7 +144,9 @@ fg_bg (WORD_LIST *list, int foreground)
|
||||
|
||||
if (INVALID_JOB (job))
|
||||
{
|
||||
if (job != DUP_JOB)
|
||||
if (job == BAD_JOBSPEC)
|
||||
sh_invalidjob (list->word->word);
|
||||
else if (job != DUP_JOB)
|
||||
sh_badjob (list ? list->word->word : _("current"));
|
||||
|
||||
goto failure;
|
||||
|
||||
+5
-2
@@ -155,7 +155,7 @@ jobs_builtin (WORD_LIST *list)
|
||||
BLOCK_CHILD (set, oset);
|
||||
job = get_job_spec (list);
|
||||
|
||||
if ((job == NO_JOB) || jobs == 0 || get_job_by_jid (job) == 0)
|
||||
if ((job == NO_JOB) || jobs == 0 || INVALID_JOB (job) || get_job_by_jid (job) == 0)
|
||||
{
|
||||
sh_badjob (list->word->word);
|
||||
any_failed++;
|
||||
@@ -287,7 +287,10 @@ disown_builtin (WORD_LIST *list)
|
||||
|
||||
if (job == NO_JOB || jobs == 0 || INVALID_JOB (job))
|
||||
{
|
||||
sh_badjob (list ? list->word->word : _("current"));
|
||||
if (job == BAD_JOBSPEC)
|
||||
sh_invalidjob (list->word->word);
|
||||
else
|
||||
sh_badjob (list ? list->word->word : _("current"));
|
||||
retval = EXECUTION_FAILURE;
|
||||
}
|
||||
else if (nohup_only)
|
||||
|
||||
@@ -207,7 +207,11 @@ use_sigspec:
|
||||
#if defined (JOB_CONTROL)
|
||||
else if (*list->word->word && *list->word->word != '%')
|
||||
{
|
||||
#if 1
|
||||
sh_badpid (list->word->word);
|
||||
#else
|
||||
builtin_error (_("%s: arguments must be process or job IDs"), list->word->word);
|
||||
#endif
|
||||
CONTINUE_OR_FAIL;
|
||||
}
|
||||
else if (*word)
|
||||
|
||||
@@ -380,6 +380,8 @@ set_waitlist (WORD_LIST *list)
|
||||
}
|
||||
else if (l->word->word[0] == '%')
|
||||
sh_badjob (l->word->word);
|
||||
else if (job == BAD_JOBSPEC)
|
||||
sh_invalidjob (l->word->word);
|
||||
else
|
||||
sh_badpid (l->word->word);
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user