Date: Tue, 27 Sep 2016 20:40:44 +0000 (UTC) From: Toomas Soome <tsoome@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306380 - head/sys/boot/common Message-ID: <201609272040.u8RKeiTZ081975@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: tsoome Date: Tue Sep 27 20:40:44 2016 New Revision: 306380 URL: https://svnweb.freebsd.org/changeset/base/306380 Log: loader command interpreter should reset command_errmsg The command interpreter does leave command_errmsg as is after printing its content, assuming the next command will reset it in bf_command(). However, in case the forth native word is defined as builtin, the bf_command is not used and forth words will also end up the command_errmsg content printed. Since command_errmsg is pointer to actual error message, which can be static read only string, we can not just set *command_errmsg = '\0', instead we need to reset the pointer itself. Illumos issue: https://www.illumos.org/issues/7405 Reported by: Igor Kozhukhov. Reviewed by: allanjude Approved by: allanjude (mentor) Differential Revision: https://reviews.freebsd.org/D8032 Modified: head/sys/boot/common/interp_forth.c Modified: head/sys/boot/common/interp_forth.c ============================================================================== --- head/sys/boot/common/interp_forth.c Tue Sep 27 19:36:12 2016 (r306379) +++ head/sys/boot/common/interp_forth.c Tue Sep 27 20:40:44 2016 (r306380) @@ -325,13 +325,15 @@ bf_run(char *line) printf("Parse error!\n"); break; default: - /* Hopefully, all other codes filled this buffer */ - printf("%s\n", command_errmsg); + if (command_errmsg != NULL) { + printf("%s\n", command_errmsg); + command_errmsg = NULL; + } } if (result == VM_USEREXIT) panic("interpreter exit"); setenv("interpret", bf_vm->state ? "" : "OK", 1); - return result; + return (result); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201609272040.u8RKeiTZ081975>