dot

packages and services management
Log | Files | Refs | README

commit 5f8b8a8c4c4ecf76e74a29184f3971fd048c1cd3
parent 1743de161b206dd98a1433d7978f21c3f73b0763
Author: Josuah Demangeon <mail@josuah.net>
Date:   Wed, 10 Jan 2018 01:49:34 +0100

handle edge case

Diffstat:
Mbin/lt | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/lt b/bin/lt @@ -12,9 +12,9 @@ awk -vLINE='| ' -vNODE='|- ' -vTAIL='`- ' -vVOID=' ' ' for (i = 2; i <= count; i++) line_v[NR":"i] = LINE; sub("\t.*", "", $0); - line_v[NR":"i - 1] = NODE; - line_v[NR":"1] = sprintf("%10d ", $0); - line_v[NR"name"] = path_v[count]; + line_v[NR":"count] = NODE; + line_v[NR":"1] = sprintf("%10d ", $0); + line_v[NR"name"] = count == 1 ? "." : path_v[count]; } END {