None: Fix SIGABRT when sourcing profile/env v1 PROPOSED

Drew DeVault: 1
 Fix SIGABRT when sourcing profile/env

 1 files changed, 3 insertions(+), 0 deletions(-)
View this thread in the archives
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~emersion/mrsh-dev/%3C20190421154450.7688-1-sir%40cmpwn.com%3E/mbox | git am -3
Learn more about email & git

[PATCH] Fix SIGABRT when sourcing profile/env Export this patch

---
Not sure if this is getting at the problem exactly but it seems close.
 shell/entry.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/shell/entry.c b/shell/entry.c
index d12c54f..3d02c6b 100644
--- a/shell/entry.c
+++ b/shell/entry.c
@@ -94,8 +94,11 @@ static void source_file(struct mrsh_state *state, char *path) {
 	if (access(path, F_OK) == -1) {
 		return;
 	}
+	bool interactive = state->interactive;
+	state->interactive = false;
 	char *env_argv[] = { ".", path };
 	mrsh_run_builtin(state, sizeof(env_argv) / sizeof(env_argv[0]), env_argv);
+	state->interactive = interactive;
 }
 
 void mrsh_source_profile(struct mrsh_state *state) {
-- 
2.21.0