mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 08:24:16 +09:00
[unicode] fix definition of _wcschr search char
This commit is contained in:
@@ -363,7 +363,15 @@ static BOOL printer_load_from_config(const rdpSettings* settings, rdpPrinter* pr
|
||||
if (!Stream_EnsureRemainingCapacity(printer_dev->device.data, PrinterNameLen))
|
||||
goto fail;
|
||||
|
||||
for (wptr = wname; (wptr = _wcschr(wptr, L'\\'));)
|
||||
union
|
||||
{
|
||||
char c[2];
|
||||
WCHAR w;
|
||||
} backslash;
|
||||
backslash.c[0] = '\\';
|
||||
backslash.c[1] = '\0';
|
||||
|
||||
for (wptr = wname; (wptr = _wcschr(wptr, backslash.w));)
|
||||
*wptr = L'_';
|
||||
Stream_Write(printer_dev->device.data, wname, PrinterNameLen);
|
||||
|
||||
|
||||
@@ -692,7 +692,14 @@ static void* convert_filedescriptors_to_file_list(wClipboard* clipboard, UINT32
|
||||
const char* header, const char* lineprefix,
|
||||
const char* lineending, BOOL skip_last_lineending)
|
||||
{
|
||||
const WCHAR backslash = '\\';
|
||||
union
|
||||
{
|
||||
char c[2];
|
||||
WCHAR w;
|
||||
} backslash;
|
||||
backslash.c[0] = '\\';
|
||||
backslash.c[1] = '\0';
|
||||
|
||||
const FILEDESCRIPTORW* descriptors = NULL;
|
||||
UINT32 nrDescriptors = 0;
|
||||
size_t count, x, alloc, pos, baseLength = 0;
|
||||
@@ -740,7 +747,7 @@ static void* convert_filedescriptors_to_file_list(wClipboard* clipboard, UINT32
|
||||
{
|
||||
const FILEDESCRIPTORW* dsc = &descriptors[x];
|
||||
|
||||
if (_wcschr(dsc->cFileName, backslash) == NULL)
|
||||
if (_wcschr(dsc->cFileName, backslash.w) == NULL)
|
||||
{
|
||||
alloc += ARRAYSIZE(dsc->cFileName) *
|
||||
8; /* Overallocate, just take the biggest value the result path can have */
|
||||
@@ -766,7 +773,7 @@ static void* convert_filedescriptors_to_file_list(wClipboard* clipboard, UINT32
|
||||
{
|
||||
const FILEDESCRIPTORW* dsc = &descriptors[x];
|
||||
BOOL fail = TRUE;
|
||||
if (_wcschr(dsc->cFileName, backslash) != NULL)
|
||||
if (_wcschr(dsc->cFileName, backslash.w) != NULL)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user