diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2021-06-05 23:42:03 +0200 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2021-06-08 18:39:16 +0200 |
commit | 4686d184967c0c747777c8edcc6b00dc023b8aa9 (patch) | |
tree | b3775d06e14450117c4c17b85e87fa635a02c689 /src/spawn.c | |
parent | 9618aadc5e31c688247f57ac55fe4e97a440f5c3 (diff) | |
download | sciteco-4686d184967c0c747777c8edcc6b00dc023b8aa9.tar.gz |
Windows: normalize $COMSPEC
* Environment variables are case insensitive on Windows
while SciTECO variables are case sensitive.
We must therefore make sure that we first unset any $COMSPEC or $ComSpec
from the environment before resetting it, thereby fixing its case.
* Fixes command execution via <EC> on systems where the variable
was not called $ComSpec.
Diffstat (limited to 'src/spawn.c')
-rw-r--r-- | src/spawn.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/spawn.c b/src/spawn.c index 00ff3ad..be2489b 100644 --- a/src/spawn.c +++ b/src/spawn.c @@ -83,7 +83,7 @@ teco_parse_shell_command_line(const gchar *cmdline, GError **error) #ifdef G_OS_WIN32 if (!(teco_ed & TECO_ED_SHELLEMU)) { - teco_qreg_t *reg = teco_qreg_table_find(&teco_qreg_table_globals, "$ComSpec", 8); + teco_qreg_t *reg = teco_qreg_table_find(&teco_qreg_table_globals, "$COMSPEC", 8); g_assert(reg != NULL); teco_string_t comspec; if (!reg->vtable->get_string(reg, &comspec.data, &comspec.len, error)) @@ -91,7 +91,7 @@ teco_parse_shell_command_line(const gchar *cmdline, GError **error) argv = g_new(gchar *, 5); /* - * FIXME: What if $ComSpec contains null-bytes? + * FIXME: What if $COMSPEC contains null-bytes? */ argv[0] = comspec.data; argv[1] = g_strdup("/q"); @@ -414,7 +414,7 @@ gboolean teco_state_execute_process_edit_cmd(teco_machine_main_t *ctx, teco_mach * * <command> execution is by default platform-dependent. * On DOS-like systems like Windows, <command> is passed to - * the command interpreter specified in the \fB$ComSpec\fP + * the command interpreter specified in the \fB$COMSPEC\fP * environment variable with the \(lq/q\(rq and \(lq/c\(rq * command-line arguments. * On UNIX-like systems, <command> is passed to the interpreter |