Please review changes against upstream code using SCM,
see the Vcs-* tags in debian/control for its location.

--- mksh-46.orig/sh.h
+++ mksh-46/sh.h
@@ -164,7 +164,7 @@
 #endif
 
 #ifdef EXTERN
-__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.654 2013/05/02 21:59:52 tg Exp $");
+__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.655 2013/05/08 11:16:19 tg Exp $");
 #endif
 #define MKSH_VERSION "R46 2013/05/02"
 
@@ -522,6 +522,7 @@ char *ucstrstr(char *, const char *);
 
 #if (!defined(MKSH_BUILDMAKEFILE4BSD) && !defined(MKSH_BUILDSH)) || (MKSH_BUILD_R != 461)
 #error Must run Build.sh to compile this.
+extern void thiswillneverbedefinedIhope(void);
 int
 im_sorry_dave(void)
 {
--- mksh-46.orig/Build.sh
+++ mksh-46/Build.sh
@@ -1,5 +1,5 @@
 #!/bin/sh
-srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.630 2013/05/02 21:59:44 tg Exp $'
+srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.635 2013/05/22 19:24:32 tg Exp $'
 #-
 # Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
 #		2011, 2012, 2013
@@ -28,6 +28,9 @@ srcversion='$MirOS: src/bin/mksh/Build.s
 LC_ALL=C
 export LC_ALL
 
+echo "For the build logs, demonstrate that /dev/null and /dev/tty exist:"
+ls -l /dev/null /dev/tty
+
 case $ZSH_VERSION:$VERSION in
 :zsh*) ZSH_VERSION=2 ;;
 esac
@@ -63,7 +66,7 @@ vq() {
 rmf() {
 	for _f in "$@"; do
 		case $_f in
-		Build.sh|check.pl|check.t|dot.mkshrc|*.c|*.h|mksh.1) ;;
+		Build.sh|check.pl|check.t|dot.mkshrc|*.c|*.h|lksh.1|mksh.1) ;;
 		*) rm -f "$_f" ;;
 		esac
 	done
@@ -190,6 +193,7 @@ ac_testn() {
 ac_ifcpp() {
 	expr=$1; shift
 	ac_testn "$@" <<-EOF
+		extern int thiswillneverbedefinedIhope(void);
 		int main(void) { return (
 		#$expr
 		    0
@@ -458,7 +462,7 @@ oswarn=
 ccpc=-Wc,
 ccpl=-Wl,
 tsts=
-ccpr='|| for _f in ${tcfn}*; do case $_f in Build.sh|check.pl|check.t|dot.mkshrc|*.c|*.h|mksh.1) ;; *) rm -f "$_f" ;; esac; done'
+ccpr='|| for _f in ${tcfn}*; do case $_f in Build.sh|check.pl|check.t|dot.mkshrc|*.c|*.h|lksh.1|mksh.1) ;; *) rm -f "$_f" ;; esac; done'
 
 # Evil hack
 if test x"$TARGET_OS" = x"Android"; then
@@ -1177,6 +1181,7 @@ i=0
 if test $ct = gcc; then
 	# The following tests run with -Werror (gcc only) if possible
 	NOWARN=$DOWARN; phase=u
+	ac_flags 1 wnodeprecateddecls -Wno-deprecated-declarations
 	# mksh is not written in CFrustFrust!
 	ac_flags 1 no_eh_frame -fno-asynchronous-unwind-tables
 	ac_flags 1 fnostrictaliasing -fno-strict-aliasing
@@ -1290,6 +1295,7 @@ test $ct = pcc && phase=u
 #
 ac_test attribute_bounded '' 'for __attribute__((__bounded__))' <<-'EOF'
 	#if defined(__TenDRA__) || (defined(__GNUC__) && (__GNUC__ < 2))
+	extern int thiswillneverbedefinedIhope(void);
 	/* force a failure: TenDRA and gcc 1.42 have false positive here */
 	int main(void) { return (thiswillneverbedefinedIhope()); }
 	#else
@@ -1310,6 +1316,7 @@ ac_test attribute_bounded '' 'for __attr
 EOF
 ac_test attribute_format '' 'for __attribute__((__format__))' <<-'EOF'
 	#if defined(__TenDRA__) || (defined(__GNUC__) && (__GNUC__ < 2))
+	extern int thiswillneverbedefinedIhope(void);
 	/* force a failure: TenDRA and gcc 1.42 have false positive here */
 	int main(void) { return (thiswillneverbedefinedIhope()); }
 	#else
@@ -1324,6 +1331,7 @@ ac_test attribute_format '' 'for __attri
 EOF
 ac_test attribute_noreturn '' 'for __attribute__((__noreturn__))' <<-'EOF'
 	#if defined(__TenDRA__) || (defined(__GNUC__) && (__GNUC__ < 2))
+	extern int thiswillneverbedefinedIhope(void);
 	/* force a failure: TenDRA and gcc 1.42 have false positive here */
 	int main(void) { return (thiswillneverbedefinedIhope()); }
 	#else
@@ -1336,6 +1344,7 @@ ac_test attribute_noreturn '' 'for __att
 EOF
 ac_test attribute_unused '' 'for __attribute__((__unused__))' <<-'EOF'
 	#if defined(__TenDRA__) || (defined(__GNUC__) && (__GNUC__ < 2))
+	extern int thiswillneverbedefinedIhope(void);
 	/* force a failure: TenDRA and gcc 1.42 have false positive here */
 	int main(void) { return (thiswillneverbedefinedIhope()); }
 	#else
@@ -1345,6 +1354,7 @@ ac_test attribute_unused '' 'for __attri
 EOF
 ac_test attribute_used '' 'for __attribute__((__used__))' <<-'EOF'
 	#if defined(__TenDRA__) || (defined(__GNUC__) && (__GNUC__ < 2))
+	extern int thiswillneverbedefinedIhope(void);
 	/* force a failure: TenDRA and gcc 1.42 have false positive here */
 	int main(void) { return (thiswillneverbedefinedIhope()); }
 	#else
@@ -1531,7 +1541,7 @@ else
 		#define EXTERN
 		#define MKSH_INCLUDES_ONLY
 		#include "sh.h"
-		__RCSID("$MirOS: src/bin/mksh/Build.sh,v 1.630 2013/05/02 21:59:44 tg Exp $");
+		__RCSID("$MirOS: src/bin/mksh/Build.sh,v 1.635 2013/05/22 19:24:32 tg Exp $");
 		int main(void) { printf("Hello, World!\n"); return (0); }
 EOF
 	case $cm in
@@ -1747,7 +1757,7 @@ EOF
 ac_test setresugid <<-'EOF'
 	#include <sys/types.h>
 	#include <unistd.h>
-	int main(void) { setresuid(0,0,0); return (setresgid(0,0,0)); }
+	int main(void) { return (setresuid(0,0,0) + setresgid(0,0,0)); }
 EOF
 
 ac_test setgroups setresugid 0 <<-'EOF'
@@ -2268,8 +2278,10 @@ test 1 = $eq && e=:
 $e
 $e Installing the shell:
 $e "# $i -c -s -o root -g bin -m 555 $tfn /bin/$tfn"
-$e "# grep -x /bin/$tfn /etc/shells >/dev/null || echo /bin/$tfn >>/etc/shells"
-$e "# $i -c -o root -g bin -m 444 dot.mkshrc /usr/share/doc/mksh/examples/"
+if test $legacy = 0; then
+	$e "# grep -x /bin/$tfn /etc/shells >/dev/null || echo /bin/$tfn >>/etc/shells"
+	$e "# $i -c -o root -g bin -m 444 dot.mkshrc /usr/share/doc/mksh/examples/"
+fi
 $e
 $e Installing the manual:
 if test -f $tfn.cat1; then
@@ -2277,7 +2289,7 @@ if test -f $tfn.cat1; then
 	    "/usr/share/man/cat1/$tfn.0"
 	$e or
 fi
-$e "# $i -c -o root -g bin -m 444 mksh.1 /usr/share/man/man1/$tfn.1"
+$e "# $i -c -o root -g bin -m 444 $tfn.1 /usr/share/man/man1/$tfn.1"
 $e
 $e Run the regression test suite: ./test.sh
 $e Please also read the sample file dot.mkshrc and the fine manual.
--- mksh-46.orig/lksh.1
+++ mksh-46/lksh.1
@@ -1,4 +1,4 @@
-.\" $MirOS: src/bin/mksh/lksh.1,v 1.4 2013/05/02 20:21:43 tg Exp $
+.\" $MirOS: src/bin/mksh/lksh.1,v 1.5 2013/05/22 18:18:06 tg Exp $
 .\"-
 .\" Copyright (c) 2008, 2009, 2010, 2012, 2013
 .\"	Thorsten “mirabilos” Glaser <tg@mirbsd.org>
@@ -72,7 +72,7 @@
 .\" with -mandoc, it might implement .Mx itself, but we want to
 .\" use our own definition. And .Dd must come *first*, always.
 .\"
-.Dd $Mdocdate: May 2 2013 $
+.Dd $Mdocdate: May 22 2013 $
 .\"
 .\" Check which macro package we use, and do other -mdoc setup.
 .\"
@@ -179,10 +179,6 @@ has the following differences from
 .Nm mksh :
 .Bl -bullet
 .It
-.Nm
-is not suitable for use as
-.Pa /bin/sh .
-.It
 There is no explicit support for interactive use,
 nor any command line editing or history code.
 Hence,
@@ -262,6 +258,14 @@ does not keep file descriptors \*(Gt 2 p
 .Pp
 .Pa https://www.mirbsd.org/ksh\-chan.htm
 .Sh CAVEATS
+To use
+.Nm
+as
+.Pa /bin/sh ,
+compilation to enable
+.Ic set -o posix
+by default is highly recommended for better standards compliance.
+.Pp
 .Nm
 tries to make a cross between a legacy bourne/posix compatibl-ish
 shell and a legacy pdksh-alike but
