Files
haikuports/app-shells/mksh/patches/mksh-59c.patchset
Zoltán Mizsei 97300a72ee mksh: bump
2022-03-14 19:52:11 +01:00

158 lines
5.0 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
From 62b6f3d69d0e87bd1755164e866601f0bd27a048 Mon Sep 17 00:00:00 2001
From: David Wildasin <dragonmaus@posteo.net>
Date: Sun, 22 Mar 2020 13:50:21 -0400
Subject: Update shell profile paths for Haiku
diff --git a/Build.sh b/Build.sh
index 597d8ca..dadccf5 100644
--- a/Build.sh
+++ b/Build.sh
@@ -2816,7 +2816,7 @@ HAVE_CAN_FSTACKPROTECTORALL ac_flags
DEBUG dont use in production, wants gcc, implies:
DEBUG_LEAKS enable freeing resources before exiting
KSH_VERSIONNAME_VENDOR_EXT when patching; space+plus+word (e.g. " +SuSE")
-MKSHRC_PATH "~/.mkshrc" (do not change)
+MKSHRC_PATH "~/config/settings/mkshrc" (do not change)
MKSH_A4PB force use of arc4random_pushb
MKSH_ASSUME_UTF8 (0=disabled, 1=enabled; default: unset)
MKSH_BINSHPOSIX if */sh or */-sh, enable set -o posix
diff --git a/check.t b/check.t
index 311f5c1..67c3f11 100644
--- a/check.t
+++ b/check.t
@@ -8399,7 +8399,7 @@ expected-stderr-pattern:
---
name: mkshrc-1
description:
- Check that ~/.mkshrc works correctly.
+ Check that ~/config/settings/mkshrc works correctly.
Part 1: verify user environment is not read (internal)
stdin:
echo x $FNORD
@@ -8408,9 +8408,9 @@ expected-stdout:
---
name: mkshrc-2a
description:
- Check that ~/.mkshrc works correctly.
+ Check that ~/config/settings/mkshrc works correctly.
Part 2: verify mkshrc is not read (non-interactive shells)
-file-setup: file 644 ".mkshrc"
+file-setup: file 644 "mkshrc"
FNORD=42
env-setup: !HOME=.!ENV=!
stdin:
@@ -8420,9 +8420,9 @@ expected-stdout:
---
name: mkshrc-2b
description:
- Check that ~/.mkshrc works correctly.
+ Check that ~/config/settings/mkshrc works correctly.
Part 2: verify mkshrc can be read (interactive shells)
-file-setup: file 644 ".mkshrc"
+file-setup: file 644 "mkshrc"
FNORD=42
need-ctty: yes
arguments: !-i!
@@ -8436,9 +8436,9 @@ expected-stderr-pattern:
---
name: mkshrc-3
description:
- Check that ~/.mkshrc works correctly.
+ Check that ~/config/settings/mkshrc works correctly.
Part 3: verify mkshrc can be turned off
-file-setup: file 644 ".mkshrc"
+file-setup: file 644 "mkshrc"
FNORD=42
env-setup: !HOME=.!ENV=nonexistant!
stdin:
diff --git a/dot.mkshrc b/dot.mkshrc
index f06dbc6..9e409d4 100644
--- a/dot.mkshrc
+++ b/dot.mkshrc
@@ -21,7 +21,7 @@
# damage or existence of a defect, except proven that it results out
# of said person's immediate fault when using the work as intended.
#-
-# ${ENV:-~/.mkshrc}: mksh initialisation file for interactive shells
+# ${ENV:-~/config/settings/mkshrc}: mksh initialisation file for interactive shells
# catch non-mksh, non-lksh, trying to run this file
case ${KSH_VERSION:-} in
diff --git a/funcs.c b/funcs.c
index ee2c9f6..90abad8 100644
--- a/funcs.c
+++ b/funcs.c
@@ -1816,7 +1816,7 @@ c_read(const char **wp)
if (Flag(FTALKING_I) && isatty(fd)) {
/*
* set prompt in case this is
- * called from .profile or $ENV
+ * called from profile or $ENV
*/
set_prompt(PS2, NULL);
pprompt(prompt, 0);
diff --git a/main.c b/main.c
index 3154f9f..695b818 100644
--- a/main.c
+++ b/main.c
@@ -38,7 +38,7 @@
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.374 2020/10/01 20:28:54 tg Exp $");
#ifndef MKSHRC_PATH
-#define MKSHRC_PATH "~/.mkshrc"
+#define MKSHRC_PATH "~/config/settings/mkshrc"
#endif
#ifndef MKSH_DEFAULT_TMPDIR
@@ -650,7 +650,7 @@ main_init(int argc, const char *argv[], Source **sp, struct block **lp)
break;
}
- /* Disable during .profile/ENV reading */
+ /* Disable during profile/ENV reading */
restricted_shell |= Flag(FRESTRICTED);
Flag(FRESTRICTED) = 0;
errexit = Flag(FERREXIT);
@@ -693,7 +693,7 @@ main_init(int argc, const char *argv[], Source **sp, struct block **lp)
baseline_flags[(int)FPRIVILEGED] = Flag(FPRIVILEGED);
} else {
if (Flag(FLOGIN))
- include(substitute("$HOME/.profile", 0), 0, NULL, true);
+ include(substitute("$HOME/config/settings/profile", 0), 0, NULL, true);
if (Flag(FTALKING)) {
cp = substitute("${ENV:-" MKSHRC_PATH "}", DOTILDE);
if (cp[0] != '\0')
@@ -781,7 +781,7 @@ include(const char *name, int argc, const char **argv, bool intr_ok)
return (exstat & 0xFF);
case LINTR:
/*
- * intr_ok is set if we are including .profile or $ENV.
+ * intr_ok is set if we are including profile or $ENV.
* If user ^Cs out, we don't want to kill the shell...
*/
if (intr_ok && ((exstat & 0xFF) - 128) != SIGTERM)
diff --git a/mksh.1 b/mksh.1
index 6cfb70c..aeadb91 100644
--- a/mksh.1
+++ b/mksh.1
@@ -6863,13 +6863,13 @@ removed to the history and a new prompt to be printed.
.El
.Sh FILES
.Bl -tag -width XetcXsuid_profile -compact
-.It Pa \*(TI/.mkshrc
+.It Pa \*(TI/config/settings/mkshrc
User mkshrc profile (non-privileged interactive shells); see
.Sx Startup files.
The location can be changed at compile time (e.g. for embedded systems);
AOSP Android builds use
.Pa /system/etc/mkshrc .
-.It Pa \*(TI/.profile
+.It Pa \*(TI/config/settings/profile
User profile (non-privileged login shells); see
.Sx Startup files
near the top of this manual.
--
2.30.2