Compare commits
1 Commits
24dbd3a2e2
...
1ac58222b8
| Author | SHA1 | Date | |
|---|---|---|---|
|
1ac58222b8
|
@@ -143,8 +143,8 @@ launch_editor(gchar* initial_content, void (*callback)(gchar* content, void* dat
|
||||
g_source_unref(sigchld_warmup);
|
||||
|
||||
// Build the editor's env without LINES/COLUMNS pre-fork, so the child only
|
||||
// swaps environ (async-signal-safe) instead of calling unsetenv(). The
|
||||
// editor's (n)curses then reads the live window via ioctl(TIOCGWINSZ).
|
||||
// reassigns environ instead of calling unsetenv() between fork and exec.
|
||||
// The editor's (n)curses then reads the live window via ioctl(TIOCGWINSZ).
|
||||
gsize env_len = 0;
|
||||
while (environ[env_len]) {
|
||||
env_len++;
|
||||
@@ -191,7 +191,7 @@ launch_editor(gchar* initial_content, void (*callback)(gchar* content, void* dat
|
||||
editor_pid = pid;
|
||||
g_child_watch_add((GPid)pid, _editor_exit_cb, ctx);
|
||||
g_strfreev(editor_argv);
|
||||
g_free(editor_env); // array only; strings are borrowed from environ
|
||||
g_free(editor_env); // frees the parent's array only; the child keeps its own COW copy until execvp
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user