From owner-svn-src-all@freebsd.org Thu Aug 31 15:53:28 2017 Return-Path: Delivered-To: svn-src-all@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 C01D1E00BD0; Thu, 31 Aug 2017 15:53:28 +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 8FF6381C5F; Thu, 31 Aug 2017 15:53:28 +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 v7VFrR96096235; Thu, 31 Aug 2017 15:53:27 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7VFrRiF096234; Thu, 31 Aug 2017 15:53:27 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201708311553.v7VFrRiF096234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 31 Aug 2017 15:53:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323056 - head/lib/libefivar X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/lib/libefivar X-SVN-Commit-Revision: 323056 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Aug 2017 15:53:28 -0000 Author: imp Date: Thu Aug 31 15:53:27 2017 New Revision: 323056 URL: https://svnweb.freebsd.org/changeset/base/323056 Log: Fix printing File() nodes in device paths. Device paths encoded into the FILEPATH_DEVICE_PATH are UCS2 not ASCII/UTF8. Convert to utf8 and print that when printing File paths. Also, since File may be at the end of a long device path, output File() around the path so it doesn't just show up as random nodes that might accidentally match real node paths names and cause errors. Modified: head/lib/libefivar/efivar-dp-format.c Modified: head/lib/libefivar/efivar-dp-format.c ============================================================================== --- head/lib/libefivar/efivar-dp-format.c Thu Aug 31 14:27:09 2017 (r323055) +++ head/lib/libefivar/efivar-dp-format.c Thu Aug 31 15:53:27 2017 (r323056) @@ -36,6 +36,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "efichar.h" + #include "efi-osdep.h" #include "efivar-dp.h" @@ -1872,9 +1874,12 @@ DevPathToTextFilePath ( ) { FILEPATH_DEVICE_PATH *Fp; + char *name = NULL; Fp = DevPath; - UefiDevicePathLibCatPrint (Str, "%s", Fp->PathName); + ucs2_to_utf8(Fp->PathName, &name); + UefiDevicePathLibCatPrint (Str, "File(%s)", name); + free(name); } /**