ncneofetch: don't print (null) for distro_pretty

This commit is contained in:
Nick Black 2020-06-28 06:43:29 -04:00
parent d52ced823c
commit d5dca33e00
2 changed files with 5 additions and 3 deletions

View File

@ -261,7 +261,7 @@ freebsd_ncneofetch(fetched_info* fi){
.name = "FreeBSD",
.logofile = NULL, // FIXME
};
(void)fi; // FIXME set up distro_pretty
fi->distro_pretty = NULL;
return &fbsd;
}
@ -309,7 +309,9 @@ infoplane(struct notcurses* nc, const fetched_info* fi){
ncplane_set_fg_rgb(infop, 0xd0, 0xd0, 0xd0);
ncplane_set_attr(infop, NCSTYLE_UNDERLINE);
ncplane_printf_aligned(infop, 1, NCALIGN_LEFT, " %s %s", fi->kernel, fi->kernver);
ncplane_printf_aligned(infop, 1, NCALIGN_RIGHT, "%s ", fi->distro_pretty);
if(fi->distro_pretty){
ncplane_printf_aligned(infop, 1, NCALIGN_RIGHT, "%s ", fi->distro_pretty);
}
ncplane_set_attr(infop, NCSTYLE_NONE);
#ifdef __linux__
struct sysinfo sinfo;

View File

@ -360,7 +360,7 @@ TEST_CASE("NCPlane") {
REQUIRE(0 < u2);
REQUIRE(strlen(w1) == u1);
REQUIRE(strlen(w2) == u2);
CHECK(cell_double_wide_p(&c1));
CHECK(mbswidth(w1) == 1 + cell_double_wide_p(&c1));
CHECK_FALSE(cell_double_wide_p(&c2));
cell_release(n_, &c1);
cell_release(n_, &c2);