1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-04 21:47:31 +03:00

Merge pull request #23290 from keszybz/three-fixes

Three fixes
This commit is contained in:
Yu Watanabe 2022-05-07 04:57:36 +09:00 committed by GitHub
commit 0139026b3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 35 additions and 11 deletions

View File

@ -11,7 +11,7 @@ SPDX-License-Identifier: LGPL-2.1-or-later
2. Update the contributors list in NEWS (`ninja -C build git-contrib`)
3. Update the time and place in NEWS
4. Update hwdb (`ninja -C build update-hwdb`, `ninja -C build update-hwdb-autosuspend`, commit separately).
5. Update syscall numbers (`ninja -C build update-syscall-tables update-syscall-headers`).
5. Update syscall numbers (`ninja -C build update-syscall-tables update-syscall-header`).
6. [RC1] Update version and library numbers in `meson.build`
7. Check dbus docs with `ninja -C build update-dbus-docs`
8. Tag the release: `version=vXXX-rcY && git tag -s "${version}" -m "systemd ${version}"`

View File

@ -77,7 +77,7 @@ int strv_split_full(char ***t, const char *s, const char *separators, ExtractFla
static inline char** strv_split(const char *s, const char *separators) {
char **ret;
if (strv_split_full(&ret, s, separators, 0) < 0)
if (strv_split_full(&ret, s, separators, EXTRACT_RETAIN_ESCAPE) < 0)
return NULL;
return ret;

View File

@ -1278,12 +1278,7 @@ ColorMode get_color_mode(void) {
/* We only check for the presence of the variable; value is ignored. */
cached_color_mode = COLOR_OFF;
else if (STRPTR_IN_SET(getenv("COLORTERM"),
"truecolor",
"24bit"))
cached_color_mode = COLOR_24BIT;
else if (getpid_cached() == 1)
else if (getpid_cached() == 1) {
/* PID1 outputs to the console without holding it open all the time.
*
* Note that the Linux console can only display 16 colors. We still enable 256 color
@ -1292,9 +1287,23 @@ ColorMode get_color_mode(void) {
* map them to the closest color in the 16 color palette (since kernel 3.16). Doing
* 256 colors is nice for people who invoke systemd in a container or via a serial
* link or such, and use a true 256 color terminal to do so. */
cached_color_mode = getenv_terminal_is_dumb() ? COLOR_OFF : COLOR_256;
else
cached_color_mode = terminal_is_dumb() ? COLOR_OFF : COLOR_256;
if (getenv_terminal_is_dumb())
cached_color_mode = COLOR_OFF;
} else {
if (terminal_is_dumb())
cached_color_mode = COLOR_OFF;
}
if (cached_color_mode < 0) {
/* We failed to figure out any reason to *disable* colors.
* Let's see how many colors we shall use. */
if (STRPTR_IN_SET(getenv("COLORTERM"),
"truecolor",
"24bit"))
cached_color_mode = COLOR_24BIT;
else
cached_color_mode = COLOR_256;
}
}
return cached_color_mode;

View File

@ -317,6 +317,21 @@ TEST(strv_split) {
assert_se(strv_split_full(&l, "\\", NULL, EXTRACT_UNQUOTE | EXTRACT_RELAX | EXTRACT_UNESCAPE_RELAX) == 1);
assert_se(strv_equal(l, STRV_MAKE("\\")));
l = strv_free_erase(l);
assert_se(l = strv_split("\\", NULL));
assert_se(strv_equal(l, STRV_MAKE("\\")));
l = strv_free_erase(l);
assert_se(l = strv_split("aa\\ bb\\", NULL));
assert_se(strv_equal(l, STRV_MAKE("aa\\", "bb\\")));
l = strv_free_erase(l);
assert_se(l = strv_split("aa\" bb'", NULL));
assert_se(strv_equal(l, STRV_MAKE("aa\"", "bb'")));
}
TEST(strv_split_empty) {