From owner-svn-src-head@freebsd.org Sat Dec 9 07:44:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7BF4E81E29; Sat, 9 Dec 2017 07:44:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C7B87B133; Sat, 9 Dec 2017 07:44:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vB97i0qw093257; Sat, 9 Dec 2017 07:44:00 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vB97i0YV093256; Sat, 9 Dec 2017 07:44:00 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712090744.vB97i0YV093256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 9 Dec 2017 07:44:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326728 - head/usr.sbin/efibootmgr X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/efibootmgr X-SVN-Commit-Revision: 326728 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Dec 2017 07:44:02 -0000 Author: imp Date: Sat Dec 9 07:44:00 2017 New Revision: 326728 URL: https://svnweb.freebsd.org/changeset/base/326728 Log: Indent multiple device path entries correctly. Sponsored by: Netflix Modified: head/usr.sbin/efibootmgr/efibootmgr.c Modified: head/usr.sbin/efibootmgr/efibootmgr.c ============================================================================== --- head/usr.sbin/efibootmgr/efibootmgr.c Sat Dec 9 07:43:55 2017 (r326727) +++ head/usr.sbin/efibootmgr/efibootmgr.c Sat Dec 9 07:44:00 2017 (r326728) @@ -704,6 +704,7 @@ print_loadopt_str(uint8_t *data, size_t datalen) int len; int optlen; int rv; + int indent; if (datalen < sizeof(attr) + sizeof(fplen) + sizeof(efi_char)) return; @@ -729,13 +730,15 @@ print_loadopt_str(uint8_t *data, size_t datalen) opt = walker; optlen = ep - walker; + indent = 1; while (dp < edp) { efidp_format_device_path(buf, sizeof(buf), dp, (intptr_t)(void *)edp - (intptr_t)(void *)dp); - printf(" %s\n", buf); + printf("%*s%s\n", indent, "", buf); + indent = 10 + len + 1; rv = efivar_device_path_to_unix_path(dp, &dev, &relpath, &abspath); if (rv == 0) { - printf(" %s:%s %s\n", dev, relpath, abspath); + printf("%*s%s:%s %s\n", indent + 4, "", dev, relpath, abspath); free(dev); free(relpath); free(abspath);