From 89a234c267ae9ae14663bf3536374804971a45ea Mon Sep 17 00:00:00 2001 From: obarun <eric@obarun.org> Date: Thu, 13 Dec 2018 12:08:27 +1100 Subject: [PATCH] 66-info: fix null current tree name --- src/66/66-info.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/66/66-info.c b/src/66/66-info.c index 88325f42..3727c101 100644 --- a/src/66/66-info.c +++ b/src/66/66-info.c @@ -41,7 +41,7 @@ #include <s6/s6-supervise.h>//s6_svc_ok -//#include <stdio.h> +#include <stdio.h> unsigned int VERBOSITY = 1 ; static stralloc base = STRALLOC_ZERO ; static stralloc live = STRALLOC_ZERO ; @@ -349,12 +349,15 @@ int tree_args(int argc, char const *const *argv) tree = stralloc_zero ; char *treename = gaistr(&gatree,i) ; + int cu = 0 ; if (todisplay) if (!obstr_equal(treename,argv[0])) continue ; int enabled = tree_cmd_state(VERBOSITY,"-s",treename) ; - int cu = obstr_equal(treename,currname) ; + if (currname) + cu = obstr_equal(treename,currname) ; + if (!bprintf(buffer_1,"%s%s%s%s%s%s%s\n","[Name:",treename,",Current:",cu ? "yes":"no",",Enabled:",enabled?"yes":"no","]")) goto err ; -- GitLab