File mksh-vendor-mkshrc.patch of Package mksh
Index: mksh/main.c
===================================================================
--- mksh.orig/main.c
+++ mksh/main.c
@@ -591,6 +591,11 @@ main_init(int argc, const char *argv[],
if (Flag(FLOGIN))
include(substitute("$HOME/.profile", 0), 0, NULL, true);
if (Flag(FTALKING)) {
+#if defined(MKSH_VENDOR_MKSHRC_PATH) && !defined(MKSH_LEGACY_MODE)
+ /* include vendor mkshrc */
+ include(MKSH_VENDOR_MKSHRC_PATH, 0, NULL, true);
+#endif
+
cp = substitute(substitute("${ENV:-" MKSHRC_PATH "}",
0), DOTILDE);
if (cp[0] != '\0')
Index: mksh/mksh.1
===================================================================
--- mksh.orig/mksh.1
+++ mksh/mksh.1
@@ -371,6 +371,11 @@ it is processed; non-existence is silent
A privileged shell then drops privileges if neither was the
.Fl p
option given on the command line nor set during execution of the startup files.
+.Pp
+If enabled at compile time, all interactive shells process a vendor-supplied
+initialisation file before the
+.Ev ENV
+parameter or user mkshrc profile is processed.
.Ss Command syntax
The shell begins parsing its input by removing any backslash-newline
combinations, then breaking it into