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.
This commit is contained in:
Warner Losh 2017-08-31 15:53:27 +00:00
parent 5a21cd1941
commit 0d802f5a7a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=323056

View File

@ -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);
}
/**