* grub-core/kern/emu/hostdisk_windows.c (grub_util_get_windows_path):
Always return full path. Fixes a problem with mkrelpath.
This commit is contained in:
parent
39cfdaa9a2
commit
3fff48ab45
2 changed files with 21 additions and 7 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2013-09-23 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* grub-core/kern/emu/hostdisk_windows.c (grub_util_get_windows_path):
|
||||||
|
Always return full path. Fixes a problem with mkrelpath.
|
||||||
|
|
||||||
2013-09-23 Paulo Flabiano Smorigo <pfsmorigo@br.ibm.com>
|
2013-09-23 Paulo Flabiano Smorigo <pfsmorigo@br.ibm.com>
|
||||||
|
|
||||||
* util/grub-install.in: Add GPT PReP support.
|
* util/grub-install.in: Add GPT PReP support.
|
||||||
|
|
|
@ -54,8 +54,8 @@ grub_util_get_windows_path (const char *path)
|
||||||
{
|
{
|
||||||
LPTSTR winpath;
|
LPTSTR winpath;
|
||||||
winpath = xmalloc (sizeof (winpath[0]) * PATH_MAX);
|
winpath = xmalloc (sizeof (winpath[0]) * PATH_MAX);
|
||||||
if (cygwin_conv_path (sizeof (winpath[0]) == 1 ? CCP_POSIX_TO_WIN_A
|
if (cygwin_conv_path ((sizeof (winpath[0]) == 1 ? CCP_POSIX_TO_WIN_A
|
||||||
: CCP_POSIX_TO_WIN_W, path, winpath,
|
: CCP_POSIX_TO_WIN_W) | CCP_ABSOLUTE, path, winpath,
|
||||||
sizeof (winpath[0]) * PATH_MAX))
|
sizeof (winpath[0]) * PATH_MAX))
|
||||||
grub_util_error ("%s", _("cygwin_conv_path() failed"));
|
grub_util_error ("%s", _("cygwin_conv_path() failed"));
|
||||||
return winpath;
|
return winpath;
|
||||||
|
@ -64,19 +64,28 @@ grub_util_get_windows_path (const char *path)
|
||||||
LPTSTR
|
LPTSTR
|
||||||
grub_util_get_windows_path (const char *path)
|
grub_util_get_windows_path (const char *path)
|
||||||
{
|
{
|
||||||
|
char *fpa;
|
||||||
|
const char *fp;
|
||||||
|
LPTSTR ret;
|
||||||
|
|
||||||
|
fp = fpa = xmalloc (PATH_MAX);
|
||||||
|
if (!_fullpath (fpa, path, PATH_MAX))
|
||||||
|
fp = path;
|
||||||
#if SIZEOF_TCHAR == 1
|
#if SIZEOF_TCHAR == 1
|
||||||
return xstrdup (path);
|
ret = xstrdup (fp);
|
||||||
#elif SIZEOF_TCHAR == 2
|
#elif SIZEOF_TCHAR == 2
|
||||||
size_t ssz = strlen (path);
|
size_t ssz = strlen (fp);
|
||||||
size_t tsz = 2 * (GRUB_MAX_UTF16_PER_UTF8 * ssz + 1);
|
size_t tsz = 2 * (GRUB_MAX_UTF16_PER_UTF8 * ssz + 1);
|
||||||
LPTSTR ret = xmalloc (tsz);
|
ret = xmalloc (tsz);
|
||||||
tsz = grub_utf8_to_utf16 (ret, tsz, (const grub_uint8_t *) path, ssz, NULL);
|
tsz = grub_utf8_to_utf16 (ret, tsz, (const grub_uint8_t *) fp, ssz, NULL);
|
||||||
ret[tsz] = 0;
|
ret[tsz] = 0;
|
||||||
return ret;
|
|
||||||
#else
|
#else
|
||||||
#error SIZEOF_TCHAR
|
#error SIZEOF_TCHAR
|
||||||
#error "Unsupported TCHAR size"
|
#error "Unsupported TCHAR size"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
free (fpa);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue