mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 13:39:02 +00:00
Removal of more lingering wcs2str()
This commit is contained in:
parent
cc5c411039
commit
3bf88110aa
2 changed files with 7 additions and 8 deletions
|
@ -276,6 +276,7 @@ static int vgwprintf(void (*writer)(wchar_t),
|
||||||
{
|
{
|
||||||
|
|
||||||
wchar_t *ss=0;
|
wchar_t *ss=0;
|
||||||
|
wcstring wide_ss;
|
||||||
if (is_long)
|
if (is_long)
|
||||||
{
|
{
|
||||||
ss = va_arg(va, wchar_t *);
|
ss = va_arg(va, wchar_t *);
|
||||||
|
@ -286,7 +287,8 @@ static int vgwprintf(void (*writer)(wchar_t),
|
||||||
|
|
||||||
if (ns)
|
if (ns)
|
||||||
{
|
{
|
||||||
ss = str2wcs(ns);
|
wide_ss = str2wcstring(ns);
|
||||||
|
ss = wide_ss.c_str();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -319,9 +321,6 @@ static int vgwprintf(void (*writer)(wchar_t),
|
||||||
count += maxi(width-wcslen(ss), 0);
|
count += maxi(width-wcslen(ss), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_long)
|
|
||||||
free(ss);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -330,16 +330,16 @@ wchar_t *wrealpath(const wcstring &pathname, wchar_t *resolved_path)
|
||||||
|
|
||||||
if (!narrow_res)
|
if (!narrow_res)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
const wcstring wide_res = str2wcstring(narrow_res);
|
||||||
if (resolved_path)
|
if (resolved_path)
|
||||||
{
|
{
|
||||||
wcstring tmp2 = str2wcstring(narrow_res);
|
wcslcpy(resolved_path, wide_res.c_str(), PATH_MAX);
|
||||||
wcslcpy(resolved_path, tmp2.c_str(), PATH_MAX);
|
|
||||||
res = resolved_path;
|
res = resolved_path;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
res = wcsdup(str2wcstring(narrow_res).c_str());
|
res = wcsdup(wide_res.c_str());
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue