summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2affea4)
raw | patch | inline | side by side (parent: 2affea4)
author | Johannes Sixt <j6t@kdbg.org> | |
Fri, 11 Sep 2009 17:45:07 +0000 (19:45 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 11 Sep 2009 23:35:08 +0000 (16:35 -0700) |
Previously, this environment variable was set in the pager_preexec
callback, which is conditionally-compiled only on Unix, because it is not,
and cannot be, called on Windows.
With this patch the env member of struct child_process is used to set
the environment variable, which also works on Windows.
Noticed by Alexey Borzenkov.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
callback, which is conditionally-compiled only on Unix, because it is not,
and cannot be, called on Windows.
With this patch the env member of struct child_process is used to set
the environment variable, which also works on Windows.
Noticed by Alexey Borzenkov.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pager.c | patch | blob | history |
index 4921843577e42b774457a61277b9bc3441d3ab6b..f416d38ac26042d7ed6dbf87f21bf5339e481a2e 100644 (file)
--- a/pager.c
+++ b/pager.c
FD_ZERO(&in);
FD_SET(0, &in);
select(1, &in, NULL, &in, NULL);
-
- setenv("LESS", "FRSX", 0);
}
#endif
pager_argv[2] = pager;
pager_process.argv = pager_argv;
pager_process.in = -1;
+ if (!getenv("LESS")) {
+ static const char *env[] = { "LESS=FRSX", NULL };
+ pager_process.env = env;
+ }
#ifndef __MINGW32__
pager_process.preexec_cb = pager_preexec;
#endif