From 843680e543db0608f5d6d1973ca1ecd3d7a0b817 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Thu, 27 Oct 2022 15:58:03 +0200 Subject: [PATCH] Clipboard syntesizer replaces path separators The clipboard expects windows style paths, so replace all / with \ --- winpr/libwinpr/clipboard/synthetic_file.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/winpr/libwinpr/clipboard/synthetic_file.c b/winpr/libwinpr/clipboard/synthetic_file.c index 33eecb982..ea57d83eb 100644 --- a/winpr/libwinpr/clipboard/synthetic_file.c +++ b/winpr/libwinpr/clipboard/synthetic_file.c @@ -104,6 +104,13 @@ static struct synthetic_file* make_synthetic_file(const WCHAR* local_name, const if (!file->remote_name) goto fail; + const size_t len = _wcslen(file->remote_name); + for (size_t x = 0; x < len; x++) + { + if (file->remote_name[x] == '/') + file->remote_name[x] = '\\'; + } + file->dwFileAttributes = fd.dwFileAttributes; file->ftCreationTime = fd.ftCreationTime; file->ftLastWriteTime = fd.ftLastWriteTime;