svn commit: r323056 - head/lib/libefivar
Warner Losh
imp at FreeBSD.org
Thu Aug 31 15:53:28 UTC 2017
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 <stdio.h>
#include <string.h>
+#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);
}
/**
More information about the svn-src-all
mailing list