From cf8298cb22c8b17fa35de94d0197e8e23300095f Mon Sep 17 00:00:00 2001 From: Chet Ramey Date: Wed, 18 Aug 2021 11:32:26 -0400 Subject: [PATCH] minor fixes; bad printf -v return status --- CWRU/CWRU.chlog | 20 +++++++++++++++++++- builtins/printf.def | 3 +-- lib/sh/unicode.c | 2 +- siglist.c | 3 ++- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog index 23aaef94..65e52b1f 100644 --- a/CWRU/CWRU.chlog +++ b/CWRU/CWRU.chlog @@ -1173,7 +1173,7 @@ builtins/common.c clarity arrayfunc.c - - assign_array_element: sanity check: make sure that the suubscript + - assign_array_element: sanity check: make sure that the subscript returned by array_variable_name consumes the entire NAME, otherwise flag it as a subscript error. This keeps things like `KEY=' ]'; read assoc[$KEY] <<< hello' from assigning to incomplete @@ -1691,3 +1691,21 @@ builtins/shopt.def ---- doc/{bash.1,bashref.texi} - noexpand_translation: add description of new option + + 8/16 + ---- +builtins/printf.def + - printf_builtin: initialize retval after parsing arguments, since we + use it for the `v' option. Bug report from Keith Thompson + + +lib/sh/unicode.c + - u32tocesc: fix typo that returned \uXXXXXXXX instead of \UXXXXXXXX. + From https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=992257 by + + + 8/17 + ---- +siglist.c + - include command.h before general.h for PARAMS and prototypes. Report + from Osipov, Michael (LDA IT PLM) diff --git a/builtins/printf.def b/builtins/printf.def index 38b6fa89..638be1e3 100644 --- a/builtins/printf.def +++ b/builtins/printf.def @@ -257,8 +257,6 @@ printf_builtin (list) #endif conversion_error = 0; - retval = EXECUTION_SUCCESS; - vflag = 0; reset_internal_getopt (); @@ -319,6 +317,7 @@ printf_builtin (list) format = list->word->word; tw = 0; + retval = EXECUTION_SUCCESS; garglist = orig_arglist = list->next; diff --git a/lib/sh/unicode.c b/lib/sh/unicode.c index d95d1e25..d781353b 100644 --- a/lib/sh/unicode.c +++ b/lib/sh/unicode.c @@ -145,7 +145,7 @@ u32tocesc (wc, s) if (wc < 0x10000) l = sprintf (s, "\\u%04X", wc); else - l = sprintf (s, "\\u%08X", wc); + l = sprintf (s, "\\U%08X", wc); return l; } diff --git a/siglist.c b/siglist.c index d8361dd7..ec706c90 100644 --- a/siglist.c +++ b/siglist.c @@ -1,6 +1,6 @@ /* siglist.c -- signal list for those machines that don't have one. */ -/* Copyright (C) 1989-2009 Free Software Foundation, Inc. +/* Copyright (C) 1989-2021 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. @@ -23,6 +23,7 @@ #if !defined (HAVE_SYS_SIGLIST) && !defined (HAVE_UNDER_SYS_SIGLIST) && !defined (HAVE_STRSIGNAL) #include +#include "command.h" #include "general.h" #include