]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
change some error messages so the format string isn't the return value from gettext...
authorChet Ramey <chet.ramey@case.edu>
Mon, 13 May 2024 15:36:34 +0000 (11:36 -0400)
committerChet Ramey <chet.ramey@case.edu>
Mon, 13 May 2024 15:36:34 +0000 (11:36 -0400)
26 files changed:
CWRU/CWRU.chlog
bashhist.c
builtins/bind.def
builtins/common.c
builtins/enable.def
builtins/exec.def
builtins/fc.def
builtins/help.def
builtins/mapfile.def
builtins/printf.def
builtins/read.def
builtins/source.def
builtins/ulimit.def
doc/bash.1
execute_cmd.c
execute_cmd.h
jobs.c
lib/readline/doc/readline.3
lib/readline/doc/rluser.texi
lib/readline/doc/version.texi
locale.c
parse.y
redir.c
tests/comsub2.right
tests/cond-regexp3.sub
tests/glob2.sub

index 297916106ddfeadec7d0169f0be005c73f6367f7..c7e7f024d9c837112331cd6a6f9a9ac05bb3c845 100644 (file)
@@ -9370,3 +9370,53 @@ bashline.c
 execute_cmd.c,shell.c,builtins/evalfile.c,unwind_prot.c
        - change some translated error messages to make the text more uniform
          and reduce the number of gettext() calls
+
+redir.c,parse.y,bashhist.c.locale.c
+builtins/common.c,builtins/bind.def,builtins/exec.def,builtins/fc.def
+builtins/help.def,builtins/mapfile.def,builtins/printf.def,builtins/read.def
+builtins/ulimit.def
+       - change some error messages to avoid having the format be the return
+         value from gettext() to avoid clang complaints; simplified
+         translatable strings and made them more uniform by removing printf
+         formatting directives
+
+execute_cmd.c
+       - notfound_str: cache the translated version of "command not found"
+         so we can call gettext early on and work around a macOS misfeature
+         From a MacPorts ticket https://trac.macports.org/ticket/68638
+         forwarded by Tom <tom@msbit.com.au>
+       - execute_disk_command: use notfound_str instead of calling gettext
+         every time a command isn't found
+
+execute_cmd.c,execute_cmd.h
+       - init_notfound_str: call gettext to initialize and translate
+         notfound_str
+       - execute_disk_command: call init_notfound_str before forking if it
+         hasn't been initialized
+
+locale.c
+       - set_default_locale_vars: after we set the appropriate values for the
+         locale shell variables, call init_notfound_str to force a call to
+         gettext()
+
+jobs.c
+       - wait_for: don't try to set the tty state if we're running a trap,
+         even if a process terminates due to a signal
+
+                                   5/7
+                                   ---
+builtins/enable.def
+       - enable_builtin: don't try to turn enable f into enable -f f if the
+         shell is restricted
+
+                                  5/11
+                                  ----
+
+doc/bash.1,lib/readline/doc/readline.3,lib/readline/doc/rltech.texi
+       - document some of the bindable commands bound to Home, End, Insert,
+         Page Up, and Page Down, if those keys exist
+         From a report by Xose Vazquez Perez <xose.vazquez@gmail.com> in 3/2024
+
+configure
+       - make sure to note in CHANGES that configure now supports
+         --enable-year-2038 for large time_t
index fb9935f5d42031fbec715fe17879385fdf2b6ee3..03971c44931bb7bc64e28785f27e34b781e1df4d 100644 (file)
@@ -461,7 +461,7 @@ maybe_append_history (char *filename)
          fd = open (filename, O_WRONLY|O_CREAT, 0600);
          if (fd < 0)
            {
-             builtin_error (_("%s: cannot create: %s"), filename, strerror (errno));
+             builtin_error ("%s: %s: %s", filename, _("cannot create"), strerror (errno));
              return (EXECUTION_FAILURE);
            }
          close (fd);
index 3062c1c5222beaa9965960d048727d0c05e0ac2a..5f8a47435100db5b13c5bd24b3954bc5daed7832 100644 (file)
@@ -274,7 +274,7 @@ bind_builtin (WORD_LIST *list)
       if (rl_read_init_file (initfile) != 0)
        {
          t = printable_filename (initfile, 0);
-         builtin_error (_("%s: cannot read: %s"), t, strerror (errno));
+         builtin_error ("%s: %s: %s", t, _("cannot read"), strerror (errno));
          if (t != initfile)
            free (t);
          BIND_RETURN (EXECUTION_FAILURE);
index ed672342ca603faf8ad7dc597e1e7bd8f925e578..789160ff345cc2c326aa84e4bc768d1de2df2a71 100644 (file)
@@ -297,16 +297,16 @@ sh_wrerror (void)
 #if defined (DONT_REPORT_BROKEN_PIPE_WRITE_ERRORS) && defined (EPIPE)
   if (errno != EPIPE)
 #endif /* DONT_REPORT_BROKEN_PIPE_WRITE_ERRORS && EPIPE */
-  builtin_error (_("write error: %s"), strerror (errno));
+  builtin_error ("%s: %s", _("write error"), strerror (errno));
 }
 
 void
 sh_ttyerror (int set)
 {
   if (set)
-    builtin_error (_("error setting terminal attributes: %s"), strerror (errno));
+    builtin_error ("%s: %s", _("error setting terminal attributes"), strerror (errno));
   else
-    builtin_error (_("error getting terminal attributes: %s"), strerror (errno));
+    builtin_error ("%s: %s", _("error getting terminal attributes"), strerror (errno));
 }
 
 int
@@ -596,9 +596,11 @@ get_working_directory (const char *for_whom)
 #endif
       if (the_current_working_directory == 0)
        {
-         fprintf (stderr, _("%s: error retrieving current directory: %s: %s\n"),
-                  (for_whom && *for_whom) ? for_whom : get_name_for_error (),
-                  _(bash_getcwd_errstr), strerror (errno));
+         fprintf (stderr, "%s: %s: %s: %s\n",
+          (for_whom && *for_whom) ? for_whom : get_name_for_error (),
+          _("error retrieving current directory"),
+          _(bash_getcwd_errstr),
+          strerror (errno));
          return (char *)NULL;
        }
     }
index 136884bf59eff13a90829a216b323f16413aa791..075fc03053f9e4d6cde4eb04b8040bd881c462da 100644 (file)
@@ -233,7 +233,11 @@ enable_builtin (WORD_LIST *list)
 #if defined (HAVE_DLOPEN) && defined (HAVE_DLSYM)
          /* If we try to enable a non-existent builtin, and we have dynamic
             loading, try the equivalent of `enable -f name name'. */
+#if defined (RESTRICTED_SHELL)
+         if (*command && (flags & NFLAG) == 0 && opt == EX_NOTFOUND && restricted == 0)
+#else
          if (*command && (flags & NFLAG) == 0 && opt == EX_NOTFOUND)
+#endif
            {
              int dflags, r;
              
index fc7bc67254462a5c8cf5e7bffdbd7bd51dda5182..3ca7c4f8c58574fcb84474605a8cb40d441f5b98 100644 (file)
@@ -1,7 +1,7 @@
 This file is exec.def, from which is created exec.c.
 It implements the builtin "exec" in Bash.
 
-Copyright (C) 1987-2021,2022 Free Software Foundation, Inc.
+Copyright (C) 1987-2021,2022,2024 Free Software Foundation, Inc.
 
 This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -154,9 +154,9 @@ exec_builtin (WORD_LIST *list)
       if (file_isdir (args[0]))
        {
 #if defined (EISDIR)
-         builtin_error (_("%s: cannot execute: %s"), args[0], strerror (EISDIR));
+         builtin_error ("%s: %s: %s", args[0], _("cannot execute"), strerror (EISDIR));
 #else
-         builtin_error (_("%s: cannot execute: %s"), args[0], strerror (errno));
+         builtin_error ("%s: %s: %s", args[0], _("cannot execute"), strerror (errno));
 #endif
          exit_value = EX_NOEXEC;
        }
@@ -242,7 +242,7 @@ exec_builtin (WORD_LIST *list)
   else if (executable_file (command) == 0)
     {
       errno = opt;
-      builtin_error (_("%s: cannot execute: %s"), command, strerror (errno));
+      builtin_error ("%s: %s: %s", command, _("cannot execute"), strerror (errno));
       exit_value = EX_NOEXEC;  /* As per Posix.2, 3.14.6 */
     }
   else
index 17121037a6c33cc19cf87e973e21c086d89b682f..1d88a49a1f26fde7653852eabeefb83dbcd6fb01 100644 (file)
@@ -459,7 +459,7 @@ fc_builtin (WORD_LIST *list)
       stream = sh_mktmpfp ("bash-fc", MT_USERANDOM|MT_USETMPDIR, &fn);
       if (stream == 0)
        {
-         builtin_error (_("%s: cannot open temp file: %s"), fn ? fn : "", strerror (errno));
+         builtin_error ("%s: %s: %s", fn ? fn : "", _("cannot open temp file"), strerror (errno));
          FREE (fn);
          return (EXECUTION_FAILURE);
        }
index 0831cab006340dcb6e02de9444ba4c3db3807ee3..770ded01880c8c8aa7ea6e55767ada7356b06073 100644 (file)
@@ -211,7 +211,7 @@ open_helpfile (const char *name)
   fd = open (name, O_RDONLY);
   if (fd == -1)
     {
-      builtin_error (_("%s: cannot open: %s"), name, strerror (errno));
+      builtin_error ("%s: %s: %s", name, _("cannot open"), strerror (errno));
       return -1;
     }
   return fd;
index 770d5e377b434db803cf9bc00eda39cc69433bf4..31528fa8f44cad78eba68df55fa85bd65fed3c00 100644 (file)
@@ -2,7 +2,7 @@ This file is mapfile.def, from which is created mapfile.c.
 It implements the builtin "mapfile" in Bash.
 
 Copyright (C) 2005-2006 Rocky Bernstein for Free Software Foundation, Inc.
-Copyright (C) 2008-2023 Free Software Foundation, Inc.
+Copyright (C) 2008-2024 Free Software Foundation, Inc.
 
 This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -254,7 +254,7 @@ mapfile_builtin (WORD_LIST *list)
 
          if (sh_validfd (fd) == 0)
            {
-             builtin_error (_("%d: invalid file descriptor: %s"), fd, strerror (errno));
+             builtin_error ("%d: %s: %s", fd, _("invalid file descriptor"), strerror (errno));
              return (EXECUTION_FAILURE);
            }
          break;          
index 476cc1c9bffdfc74c274e7ad04df7c2f5821691e..2a98503149e318860fc8f7d369cb833b6ef29f5d 100644 (file)
@@ -700,7 +700,7 @@ printf_builtin (WORD_LIST *list)
                        /* check for string length overflow when adjusting precision */
                        if (ckd_add (&precision, slen, 0))
                          {
-                           builtin_error (_("%%Q: string length: %s"), strerror (ERANGE));
+                           builtin_error ("%%Q: %s %s", _("string length"), strerror (ERANGE));
                            precision = -1;
                          }
                      }             
@@ -825,7 +825,7 @@ printf_builtin (WORD_LIST *list)
 static inline void
 printf_erange (char *s)
 {
-  builtin_error (_("%s: %s"), s, strerror(ERANGE));
+  builtin_error ("%s: %s", s, strerror(ERANGE));
   conversion_error = 1;
 }
 
index 28491d300e779471b7df65677e57ae1452cd9ae7..35b719676b0b85746ae26bca2ad624c448dd82cd 100644 (file)
@@ -363,7 +363,7 @@ read_builtin (WORD_LIST *list)
            fd = intval;
          if (sh_validfd (fd) == 0)
            {
-             builtin_error (_("%d: invalid file descriptor: %s"), fd, strerror (errno));
+             builtin_error ("%d: %s: %s", fd, _("invalid file descriptor"), strerror (errno));
              return (EXECUTION_FAILURE);
            }
          break;
@@ -865,7 +865,7 @@ add_char:
     {
       t_errno = errno;
       if (errno != EINTR)
-       builtin_error (_("read error: %d: %s"), fd, strerror (errno));
+       builtin_error ("%d: %s: %s", fd, _("read error"), strerror (errno));
       run_unwind_frame ("read_builtin");
       return ((t_errno != EINTR) ? EXECUTION_FAILURE : 128+lastsig);
     }
index b68d16a593a29cceda033dc9ee03330039e91cc5..51dddec6d8b3bb37c566222b44ad07859817b0d8 100644 (file)
@@ -144,7 +144,19 @@ source_builtin (WORD_LIST *list)
   else if (absolute_pathname (list->word->word))
     filename = savestring (list->word->word);
   else if (source_uses_path)
-    filename = find_path_file (list->word->word);
+    {
+#if 0
+      char *spath;
+#if defined (RESTRICTED_SHELL)
+      if (restricted == 0 && posixly_correct == 0 && (spath = path_value ("BASH_SOURCE_PATH", 1)))
+#else
+      if (posixly_correct == 0 && (spath = path_value ("BASH_SOURCE_PATH", 1)))
+#endif
+       filename = find_in_path (list->word->word, spath, FS_READABLE);
+      else
+#endif
+       filename = find_path_file (list->word->word);
+    }
   if (filename == 0)
     {
       if (source_searches_cwd == 0)
index 316d0ec33f21698a10a428ee2dafa5cac0e188ba..b5c7529af281b09b3965e43b5d032cdba21fa943 100644 (file)
@@ -456,8 +456,9 @@ ulimit_internal (int cmd, char *cmdarg, int mode, int multiple)
   opt = get_limit (limind, &soft_limit, &hard_limit);
   if (opt < 0)
     {
-      builtin_error (_("%s: cannot get limit: %s"), limits[limind].description,
-                                                strerror (errno));
+      builtin_error ("%s: %s: %s", limits[limind].description,
+                                  _("cannot get limit"),
+                                  strerror (errno));
       return (EXECUTION_FAILURE);
     }
 
@@ -501,8 +502,9 @@ ulimit_internal (int cmd, char *cmdarg, int mode, int multiple)
 
   if (set_limit (limind, real_limit, mode) < 0)
     {
-      builtin_error (_("%s: cannot modify limit: %s"), limits[limind].description,
-                                                   strerror (errno));
+      builtin_error ("%s: %s: %s", limits[limind].description,
+                                  _("cannot modify limit"),
+                                  strerror (errno));
       return (EXECUTION_FAILURE);
     }
 
@@ -724,8 +726,9 @@ print_all_limits (int mode)
       if (get_limit (i, &softlim, &hardlim) == 0)
        printone (i, (mode & LIMIT_SOFT) ? softlim : hardlim, 1);
       else if (errno != EINVAL)
-       builtin_error ("%s: cannot get limit: %s", limits[i].description,
-                                                  strerror (errno));
+       builtin_error ("%s: %s: %s", limits[i].description,
+                                    _("cannot get limit"),
+                                    strerror (errno));
     }
 }
 
@@ -787,8 +790,9 @@ set_all_limits (int mode, RLIMTYPE newlim)
   for (retval = i = 0; limits[i].option > 0; i++)
     if (set_limit (i, newlim, mode) < 0)
       {
-       builtin_error (_("%s: cannot modify limit: %s"), limits[i].description,
-                                                     strerror (errno));
+       builtin_error ("%s: %s: %s", limits[i].description,
+                                    _("cannot modify limit"),
+                                    strerror (errno));
        retval = 1;
       }
   return retval;
index 0e21f409299f15549e31cae57448272cfc07b056..f60d090e8b1f1ed76e43f4373c83bedd3b5bf3f2 100644 (file)
@@ -5,14 +5,14 @@
 .\"    Case Western Reserve University
 .\"    chet.ramey@case.edu
 .\"
-.\"    Last Change: Tue Apr 23 15:08:01 EDT 2024
+.\"    Last Change: Sat May 11 12:44:30 EDT 2024
 .\"
 .\" bash_builtins, strip all but Built-Ins section
 .\" avoid a warning about an undefined register
 .\" .if !rzY .nr zY 0
 .if \n(zZ=1 .ig zZ
 .if \n(zY=1 .ig zY
-.TH BASH 1 "2024 April 23" "GNU Bash 5.3"
+.TH BASH 1 "2024 May 11" "GNU Bash 5.3"
 .\"
 .ie \n(.g \{\
 .ds ' \(aq
@@ -6739,9 +6739,11 @@ The text between the point and mark is referred to as the \fIregion\fP.
 .TP
 .B beginning\-of\-line (C\-a)
 Move to the start of the current line.
+This may also be bound to the Home key on some keyboards.
 .TP
 .B end\-of\-line (C\-e)
 Move to the end of the line.
+This may also be bound to the End key on some keyboards.
 .TP
 .B forward\-char (C\-f)
 Move forward a character.
@@ -6851,15 +6853,17 @@ using a non-incremental search for a string supplied by the user.
 Search forward through the history using a non-incremental search for
 a string supplied by the user.
 .TP
-.B history\-search\-forward
-Search forward through the history for the string of characters
+.B history\-search\-backward
+Search backward through the history for the string of characters
 between the start of the current line and the point.
 This is a non-incremental search.
+This may be bound to the Page Up key on some keyboards.
 .TP
-.B history\-search\-backward
-Search backward through the history for the string of characters
+.B history\-search\-forward
+Search forward through the history for the string of characters
 between the start of the current line and the point.
 This is a non-incremental search.
+This may be bound to the Page Down key on some keyboards.
 .TP
 .B history\-substring\-search\-backward
 Search backward through the history for the string of characters
@@ -7016,15 +7020,18 @@ Capitalize the current (or following) word.  With a negative argument,
 capitalize the previous word, but do not move point.
 .TP
 .B overwrite\-mode
-Toggle overwrite mode.  With an explicit positive numeric argument,
-switches to overwrite mode.  With an explicit non-positive numeric
-argument, switches to insert mode.  This command affects only
-\fBemacs\fP mode; \fBvi\fP mode does overwrite differently.
+Toggle overwrite mode.
+With an explicit positive numeric argument, switches to overwrite mode.
+With an explicit non-positive numeric argument, switches to insert mode.
+This command affects only \fBemacs\fP mode;
+\fBvi\fP mode does overwrite differently.
 Each call to \fIreadline()\fP starts in insert mode.
 In overwrite mode, characters bound to \fBself\-insert\fP replace
 the text at point rather than pushing the text to the right.
 Characters bound to \fBbackward\-delete\-char\fP replace the character
-before point with a space.  By default, this command is unbound.
+before point with a space.
+By default, this command is unbound,
+but may be bound to the Insert key on some keyboards.
 .PD
 .SS Killing and Yanking
 .PD 0
index 8a5e43c3c42954096efe8fcc502aa1e2a5790634..64939fc76e9890d3de00bbb0507817f5d24203e4 100644 (file)
@@ -261,6 +261,12 @@ int subshell_level = 0;
 /* Currently-executing shell function. */
 SHELL_VAR *this_shell_function;
 
+/* Translated message printed when a command is not found. We declare it here
+   and initialize it in locale.c to work around a macOS bug that forces a
+   crash if bash calls setlocale(3) but does not call gettext(3) before
+   forking, then calls gettext() after forking. */
+char *notfound_str = 0;
+
 /* If non-zero, matches in case and [[ ... ]] are case-insensitive */
 int match_ignore_case = 0;
 
@@ -584,7 +590,7 @@ async_redirect_stdin (void)
       close (fd);
     }
   else if (fd < 0)
-    internal_error (_("cannot redirect standard input from /dev/null: %s"), strerror (errno));
+    internal_error ("%s: %s", _("cannot redirect standard input from /dev/null"), strerror (errno));
 }
 
 #define DESCRIBE_PID(pid) do { if (interactive) describe_pid (pid); } while (0)
@@ -5702,6 +5708,14 @@ setup_async_signals (void)
 
    NOTE: callers expect this to fork or exit(). */
 
+/* See comment above where notfound_str is declared. */
+void
+init_notfound_str (void)
+{
+  if (notfound_str == 0)
+    notfound_str = _("command not found");
+}
+
 /* Name of a shell function to call when a command name is not found. */
 #ifndef NOTFOUND_HOOK
 #  define NOTFOUND_HOOK "command_not_found_handle"
@@ -5759,6 +5773,8 @@ execute_disk_command (WORD_LIST *words, REDIRECT *redirects, char *command_line,
       maybe_make_export_env ();
       put_command_name_into_env (command);
     }
+  else if (command == 0 && notfound_str == 0)  /* make sure */
+    init_notfound_str ();
 
   /* We have to make the child before we check for the non-existence
      of COMMAND, since we want the error messages to be redirected. */
@@ -5845,7 +5861,7 @@ execute_disk_command (WORD_LIST *words, REDIRECT *redirects, char *command_line,
            {
              /* Make sure filenames are displayed using printable characters */
              pathname = printable_filename (pathname, 0);
-             internal_error (_("%s: command not found"), pathname);
+             internal_error ("%s: %s", pathname, notfound_str);
              exit (EX_NOTFOUND);       /* Posix.2 says the exit status is 127 */
            }
 
index 981e94a11b8bdbafd2b12ef832a16ce1411fcbf6..cd2bad86093b9c77a6aee9dc22daec136dda82f4 100644 (file)
@@ -134,4 +134,6 @@ extern void bind_lastarg (char *);
 extern void uw_dispose_fd_bitmap (void *);
 extern void uw_close (void *);
 
+extern void init_notfound_str (void);
+
 #endif /* _EXECUTE_CMD_H_ */
diff --git a/jobs.c b/jobs.c
index 63082cfec09c05c199f591d791dd498c2e522525..fb94426e7dc35cee6bfebb7d736b8e87b0fc9eae 100644 (file)
--- a/jobs.c
+++ b/jobs.c
@@ -3151,7 +3151,8 @@ if (job == NO_JOB)
 
          if (WIFSIGNALED (s) || WIFSTOPPED (s))
            {
-             set_tty_state ();
+             if (running_trap == 0 /* || WIFSTOPPED (s) */)
+               set_tty_state ();
 
              /* If the current job was stopped or killed by a signal, and
                 the user has requested it, get a possibly new window size */
index b5ca022e1ebbc693cd93761e64859665af773ea5..b36333d374fcec2d52f7829986f3b46f37d934e2 100644 (file)
@@ -6,9 +6,9 @@
 .\"    Case Western Reserve University
 .\"    chet.ramey@case.edu
 .\"
-.\"    Last Change: Fri Mar 29 11:54:44 EDT 2024
+.\"    Last Change: Sat May 11 12:44:56 EDT 2024
 .\"
-.TH READLINE 3 "2024 March 29" "GNU Readline 8.3"
+.TH READLINE 3 "2024 May 11" "GNU Readline 8.3"
 .\"
 .ie \n(.g \{\
 .ds ' \(aq
@@ -895,9 +895,11 @@ The text between the point and mark is referred to as the \fIregion\fP.
 .TP
 .B beginning\-of\-line (C\-a)
 Move to the start of the current line.
+This may also be bound to the Home key on some keyboards.
 .TP
 .B end\-of\-line (C\-e)
 Move to the end of the line.
+This may also be bound to the End key on some keyboards.
 .TP
 .B forward\-char (C\-f)
 Move forward a character.
@@ -1007,12 +1009,14 @@ between the start of the current line and the current cursor
 position (the \fIpoint\fP).
 The search string must match at the beginning of a history line.
 This is a non-incremental search.
+This may be bound to the Page Up key on some keyboards.
 .TP
 .B history\-search\-forward
 Search forward through the history for the string of characters
 between the start of the current line and the point.
 The search string must match at the beginning of a history line.
 This is a non-incremental search.
+This may be bound to the Page Down key on some keyboards.
 .TP
 .B history\-substring\-search\-backward
 Search backward through the history for the string of characters
@@ -1119,15 +1123,18 @@ Capitalize the current (or following) word.  With a negative argument,
 capitalize the previous word, but do not move point.
 .TP
 .B overwrite\-mode
-Toggle overwrite mode.  With an explicit positive numeric argument,
-switches to overwrite mode.  With an explicit non-positive numeric
-argument, switches to insert mode.  This command affects only
-\fBemacs\fP mode; \fBvi\fP mode does overwrite differently.
+Toggle overwrite mode.
+With an explicit positive numeric argument, switches to overwrite mode.
+With an explicit non-positive numeric argument, switches to insert mode.
+This command affects only \fBemacs\fP mode;
+\fBvi\fP mode does overwrite differently.
 Each call to \fIreadline()\fP starts in insert mode.
 In overwrite mode, characters bound to \fBself\-insert\fP replace
 the text at point rather than pushing the text to the right.
 Characters bound to \fBbackward\-delete\-char\fP replace the character
-before point with a space.  By default, this command is unbound.
+before point with a space.
+By default, this command is unbound,
+but may be bound to the Insert key on some keyboards.
 .PD
 .SS Killing and Yanking
 .PD 0
index 45e8a85ddfb59d846feb7f4f758d6f9dfae2f119..bc57ccf798320c4faaf56df5de2614767626da1a 100644 (file)
@@ -1229,9 +1229,11 @@ The text between the point and mark is referred to as the @dfn{region}.
 @ftable @code
 @item beginning-of-line (C-a)
 Move to the start of the current line.
+This may also be bound to the Home key on some keyboards.
 
 @item end-of-line (C-e)
 Move to the end of the line.
+This may also be bound to the End key on some keyboards.
 
 @item forward-char (C-f)
 Move forward a character.
@@ -1342,29 +1344,31 @@ through the history as necessary using a non-incremental search
 for a string supplied by the user.
 The search string may match anywhere in a history line.
 
-@item history-search-forward ()
-Search forward through the history for the string of characters
+@item history-search-backward ()
+Search backward through the history for the string of characters
 between the start of the current line and the point.
 The search string must match at the beginning of a history line.
 This is a non-incremental search.
-By default, this command is unbound.
+By default, this command is unbound, but may be bound to the Page Down
+key on some keyboards.
 
-@item history-search-backward ()
-Search backward through the history for the string of characters
+@item history-search-forward ()
+Search forward through the history for the string of characters
 between the start of the current line and the point.
 The search string must match at the beginning of a history line.
 This is a non-incremental search.
-By default, this command is unbound.
+By default, this command is unbound, but may be bound to the Page Up
+key on some keyboards.
 
-@item history-substring-search-forward ()
-Search forward through the history for the string of characters
+@item history-substring-search-backward ()
+Search backward through the history for the string of characters
 between the start of the current line and the point.
 The search string may match anywhere in a history line.
 This is a non-incremental search.
 By default, this command is unbound.
 
-@item history-substring-search-backward ()
-Search backward through the history for the string of characters
+@item history-substring-search-forward ()
+Search forward through the history for the string of characters
 between the start of the current line and the point.
 The search string may match anywhere in a history line.
 This is a non-incremental search.
@@ -1506,7 +1510,8 @@ the text at point rather than pushing the text to the right.
 Characters bound to @code{backward-delete-char} replace the character
 before point with a space.
 
-By default, this command is unbound.
+By default, this command is unbound, but may be bound to the Insert
+key on some keyboards.
 
 @end ftable
 
index 9c820a91c2510ac4f28060bdb8fa090af0384155..9c8540c9a143e026c78cc395f177f862b0361508 100644 (file)
@@ -5,7 +5,7 @@ Copyright (C) 1988-2024 Free Software Foundation, Inc.
 @set EDITION 8.3
 @set VERSION 8.3
 
-@set UPDATED 19 January 2024
-@set UPDATED-MONTH January 2024
+@set UPDATED 11 May 2024
+@set UPDATED-MONTH May 2024
 
-@set LASTCHANGE Fri Jan 19 11:01:44 EST 2024
+@set LASTCHANGE Sat May 11 12:41:28 EDT 2024
index bf4001d16aeba78032ac48b6752d3a736329b09e..5be40295e48cce6b6b74487ee68984b2cc33f472 100644 (file)
--- a/locale.c
+++ b/locale.c
@@ -1,6 +1,6 @@
 /* locale.c - Miscellaneous internationalization functions. */
 
-/* Copyright (C) 1996-2009,2012,2016-2023 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2009,2012,2016-2024 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -47,6 +47,8 @@ extern int errno;
 extern const char *locale_charset (void);
 #endif
 
+extern void init_notfound_str (void);  /* from execute_cmd.c */
+
 extern int dump_translatable_strings, dump_po_strings;
 
 int locale_utf8locale;
@@ -173,6 +175,8 @@ set_default_locale_vars (void)
       if (default_domain && *default_domain)
        bindtextdomain (default_domain, default_dir);
     }
+
+  init_notfound_str ();                /* force a gettext call early on */
 }
 
 /* Set one of the locale categories (specified by VAR) to VALUE.  Returns 1
@@ -219,9 +223,9 @@ set_locale_var (const char *var, const char *value)
       if (x == 0)
        {
          if (errno == 0)
-           internal_warning(_("setlocale: LC_ALL: cannot change locale (%s)"), lc_all);
+           internal_warning ("setlocale: LC_ALL: %s (%s)", _("cannot change locale"), lc_all);
          else
-           internal_warning(_("setlocale: LC_ALL: cannot change locale (%s): %s"), lc_all, strerror (errno));
+           internal_warning ("setlocale: LC_ALL: %s (%s): %s", _("cannot change locale"), lc_all, strerror (errno));
        }
       locale_mb_cur_max = MB_CUR_MAX;
       /* if LC_ALL == "", reset_locale_vars has already called this */
@@ -294,9 +298,9 @@ set_locale_var (const char *var, const char *value)
   if (x == 0)
     {
       if (errno == 0)
-       internal_warning(_("setlocale: %s: cannot change locale (%s)"), var, get_locale_var (var));
+       internal_warning("setlocale: %s: %s (%s)", var, _("cannot change locale"), get_locale_var (var));
       else
-       internal_warning(_("setlocale: %s: cannot change locale (%s): %s"), var, get_locale_var (var), strerror (errno));
+       internal_warning("setlocale: %s: %s (%s): %s", var, _("cannot change locale"), get_locale_var (var), strerror (errno));
     }
 
   return (x != 0);
diff --git a/parse.y b/parse.y
index d232481d5996e7f60c19256ed9bb3650f432a41a..1349480be8db0f6943d8bb038576bcd10222910a 100644 (file)
--- a/parse.y
+++ b/parse.y
@@ -2807,7 +2807,7 @@ pop_alias:
   else if (uc == 0 && shell_input_line_terminator == READERR)
     {
 #if defined (FATAL_READERROR)
-      report_error (_("script file read error: %s"), strerror (errno));
+      report_error ("%s: %s", _("script file read error"), strerror (errno));
       exit_shell (128);                /* POSIX mandated error status */
 #else
       /* Treat read errors like EOF here. */
diff --git a/redir.c b/redir.c
index a073cfda87f7006082d43bcf16ca1df778687165..37b470da71199df03eedb042a7d73c249cc99269 100644 (file)
--- a/redir.c
+++ b/redir.c
@@ -197,25 +197,25 @@ redirection_error (REDIRECT *temp, int error, char *fn)
   switch (error)
     {
     case AMBIGUOUS_REDIRECT:
-      internal_error (_("%s: ambiguous redirect"), filename);
+      internal_error ("%s: %s", filename, _("ambiguous redirect"));
       break;
 
     case NOCLOBBER_REDIRECT:
-      internal_error (_("%s: cannot overwrite existing file"), filename);
+      internal_error ("%s: %s", filename, _("cannot overwrite existing file"));
       break;
 
 #if defined (RESTRICTED_SHELL)
     case RESTRICTED_REDIRECT:
-      internal_error (_("%s: restricted: cannot redirect output"), filename);
+      internal_error ("%s: %s", filename, _("restricted: cannot redirect output"));
       break;
 #endif /* RESTRICTED_SHELL */
 
     case HEREDOC_REDIRECT:
-      internal_error (_("cannot create temp file for here-document: %s"), strerror (heredoc_errno));
+      internal_error ("%s: %s", _("cannot create temp file for here-document"), strerror (heredoc_errno));
       break;
 
     case BADVAR_REDIRECT:
-      internal_error (_("%s: cannot assign fd to variable"), filename);
+      internal_error ("%s: %s", filename, _("cannot assign fd to variable"));
       break;
 
     default:
index 3588cca708601aca71da6c7678d60f604451b7ae..1f9a3e2a30e68945e2992a56ee832757575cfbe1 100644 (file)
@@ -86,10 +86,10 @@ outside before: value
 declare -a a=([0]="1" [1]="2" [2]="3" [3]="4")
 declare -- int="2"
 after here-doc: 1
-[1]-  Running                 sleep 1 &
-[2]+  Running                 sleep 1 &
-[1]-  Running                 sleep 1 &
-[2]+  Running                 sleep 1 &
+[1]-  Running                    sleep 1 &
+[2]+  Running                    sleep 1 &
+[1]-  Running                    sleep 1 &
+[2]+  Running                    sleep 1 &
 17772 26794
 17772 26794
 we should try rhs
index d939548c5d6a01461538cd0d5d3afefeffa1ee3f..6c432d6835e669d14be893b0ab6904e37b868c13 100644 (file)
@@ -58,7 +58,7 @@ done
 [[ x =~ \\x ]] ; echo $?
 
 bs='\'
-[[ x =~ ${bs}x ]] ; echo $?
+[[ '\[' =~ ${bs}[ ]] ; echo $?
 
 [[ x =~ $'\\'x ]] ; echo $?
 [[ x =~ '\'x ]] ; echo $?
index 7425ea4a725245f2c8bf3c5556a37b154d4ed7e3..0e0482dca98162da808dfee23fd88fc90743d368 100644 (file)
@@ -18,7 +18,7 @@ if locale -a | grep -i '^zh_TW\.big5' >/dev/null ; then
         :
 else
         echo "glob2.sub: warning: you do not have the zh_TW.big5 locale installed;" >&2
-        echo "glob2.sub: warning: that will cause some of these tests to fail." >&2
+        echo "glob2.sub: warning: that may cause some of these tests to fail." >&2
 fi
 
 var='ab\'