diff --git a/src/internal/toksvc_open_impl.c b/src/internal/toksvc_open_impl.c index 030501a..b267142 100644 --- a/src/internal/toksvc_open_impl.c +++ b/src/internal/toksvc_open_impl.c @@ -72,7 +72,9 @@ static int32_t toks_open( nt_unicode_conversion_params_utf8_to_utf16 params = {0,0,0,0,0,0,0,0,0}; wchar16_t buffer[4096]; wchar16_t * wch; - size_t nbytes; + wchar16_t * mark; + wchar16_t * cap; + uint16_t nbytes; uint32_t access; nt_large_integer alloc_size; @@ -86,22 +88,27 @@ static int32_t toks_open( return status; /* convenience */ - for (wch=buffer, nbytes=params.bytes_written; nbytes; ) { + if ((mark = buffer) && (nbytes = params.bytes_written)) { + if (mark[0] == '/') { + mark++; + nbytes -= sizeof(uint16_t); + } else if (mark[0] == '\\') { + hat = 0; + } + } + + for (wch=mark,cap=&wch[nbytes/sizeof(uint16_t)]; wch