src: add support for NO_COLOR environment variable
This commit is contained in:
@@ -4,6 +4,7 @@ User visible changes for UPX
|
|||||||
|
|
||||||
Changes in 4.2.0 (XX XXX 2023):
|
Changes in 4.2.0 (XX XXX 2023):
|
||||||
* bug fixes - see https://github.com/upx/upx/milestone/13
|
* bug fixes - see https://github.com/upx/upx/milestone/13
|
||||||
|
* add support for NO_COLOR env var; see https://no-color.org/
|
||||||
|
|
||||||
Changes in 4.1.0 (08 Aug 2023):
|
Changes in 4.1.0 (08 Aug 2023):
|
||||||
* ELF: handle shared libraries with more than 2 PT_LOAD segments
|
* ELF: handle shared libraries with more than 2 PT_LOAD segments
|
||||||
|
|||||||
+6
-1
@@ -53,6 +53,7 @@ void Options::reset() noexcept {
|
|||||||
o->preserve_mode = true;
|
o->preserve_mode = true;
|
||||||
o->preserve_ownership = true;
|
o->preserve_ownership = true;
|
||||||
o->preserve_timestamp = true;
|
o->preserve_timestamp = true;
|
||||||
|
o->verbose = 2;
|
||||||
|
|
||||||
o->console = CON_FILE;
|
o->console = CON_FILE;
|
||||||
#if (ACC_OS_DOS32) && defined(__DJGPP__)
|
#if (ACC_OS_DOS32) && defined(__DJGPP__)
|
||||||
@@ -62,7 +63,11 @@ void Options::reset() noexcept {
|
|||||||
#elif 1 && defined(__linux__)
|
#elif 1 && defined(__linux__)
|
||||||
o->console = CON_INIT;
|
o->console = CON_INIT;
|
||||||
#endif
|
#endif
|
||||||
o->verbose = 2;
|
// support NO_COLOR, see https://no-color.org/
|
||||||
|
// "... when present and not an empty string (regardless of its value)"
|
||||||
|
const char *e = getenv("NO_COLOR");
|
||||||
|
if (e && e[0])
|
||||||
|
o->console = CON_FILE;
|
||||||
|
|
||||||
o->o_unix.osabi0 = 3; // 3 == ELFOSABI_LINUX
|
o->o_unix.osabi0 = 3; // 3 == ELFOSABI_LINUX
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user