From 79418433f6d86af1b6b965812d6f81b8efb5e81f Mon Sep 17 00:00:00 2001 From: jilles Date: Sun, 14 May 2017 20:17:50 +0000 Subject: MFC r317912: sh: Fix INTOFF leak after a builtin with different locale settings. After executing a builtin with different locale settings such as LC_ALL=C true SIGINT handling was left disabled indefinitely. --- bin/sh/tests/builtins/Makefile | 1 + bin/sh/tests/builtins/locale2.0 | 5 +++++ bin/sh/var.c | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 bin/sh/tests/builtins/locale2.0 (limited to 'bin') diff --git a/bin/sh/tests/builtins/Makefile b/bin/sh/tests/builtins/Makefile index bd23550..5a359f9 100644 --- a/bin/sh/tests/builtins/Makefile +++ b/bin/sh/tests/builtins/Makefile @@ -117,6 +117,7 @@ ${PACKAGE}FILES+= local7.0 .if ${MK_NLS} != "no" ${PACKAGE}FILES+= locale1.0 .endif +${PACKAGE}FILES+= locale2.0 ${PACKAGE}FILES+= printf1.0 ${PACKAGE}FILES+= printf2.0 ${PACKAGE}FILES+= printf3.0 diff --git a/bin/sh/tests/builtins/locale2.0 b/bin/sh/tests/builtins/locale2.0 new file mode 100644 index 0000000..86dd237 --- /dev/null +++ b/bin/sh/tests/builtins/locale2.0 @@ -0,0 +1,5 @@ +# $FreeBSD$ + +$SH -c 'LC_ALL=C true; kill -INT $$; echo continued' +r=$? +[ "$r" -gt 128 ] && [ "$(kill -l "$r")" = INT ] diff --git a/bin/sh/var.c b/bin/sh/var.c index 03d529b..882db9e 100644 --- a/bin/sh/var.c +++ b/bin/sh/var.c @@ -512,7 +512,7 @@ bltinunsetlocale(void) if (localevar(cmdenviron->args[i])) { setlocale(LC_ALL, ""); updatecharset(); - return; + break; } } INTON; -- cgit v1.1