chiark / gitweb /
[4/5] Apply missing fixes from upstream
[elogind.git] / src / login / sysfs-show.c
index 939bd6125e21f23a1d6598d0bc7d990daed78426..f38f06baf9dec578b42dbd298f52e7dd91c23f0d 100644 (file)
@@ -27,6 +27,7 @@
 #include "sysfs-show.h"
 #include "path-util.h"
 #include "udev-util.h"
+#include "terminal-util.h"
 
 static int show_sysfs_one(
                 struct udev *udev,
@@ -113,7 +114,7 @@ static int show_sysfs_one(
                              "%s%s:%s%s%s%s",
                              is_master ? "[MASTER] " : "",
                              subsystem, sysname,
-                             name ? " \"" : "", name ? name : "", name ? "\"" : "") < 0)
+                             name ? " \"" : "", strempty(name), name ? "\"" : "") < 0)
                         return -ENOMEM;
 
                 free(k);
@@ -121,13 +122,13 @@ static int show_sysfs_one(
                 if (!k)
                         return -ENOMEM;
 
-                printf("%s%s%s\n", prefix, lookahead ? draw_special_char(DRAW_TREE_VERT) : "  ", k);
+                printf("%s%s%s\n", prefix, lookahead ? draw_special_char(DRAW_TREE_VERTICAL) : "  ", k);
 
                 *item = next;
                 if (*item) {
                         _cleanup_free_ char *p = NULL;
 
-                        p = strappend(prefix, lookahead ? draw_special_char(DRAW_TREE_VERT) : "  ");
+                        p = strappend(prefix, lookahead ? draw_special_char(DRAW_TREE_VERTICAL) : "  ");
                         if (!p)
                                 return -ENOMEM;