summaryrefslogtreecommitdiffstats
path: root/win/rfb_win32/Clipboard.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'win/rfb_win32/Clipboard.cxx')
-rw-r--r--win/rfb_win32/Clipboard.cxx16
1 files changed, 2 insertions, 14 deletions
diff --git a/win/rfb_win32/Clipboard.cxx b/win/rfb_win32/Clipboard.cxx
index 0e290623..fca6c1df 100644
--- a/win/rfb_win32/Clipboard.cxx
+++ b/win/rfb_win32/Clipboard.cxx
@@ -1,4 +1,5 @@
/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
+ * Copyright 2012-2019 Pierre Ossman for Cendio AB
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -35,18 +36,6 @@ static LogWriter vlog("Clipboard");
//
char*
-dos2unix(const char* text) {
- int len = strlen(text)+1;
- char* unix = new char[strlen(text)+1];
- int i, j=0;
- for (i=0; i<len; i++) {
- if (text[i] != '\x0d')
- unix[j++] = text[i];
- }
- return unix;
-}
-
-char*
unix2dos(const char* text) {
int len = strlen(text)+1;
char* dos = new char[strlen(text)*2+1];
@@ -126,8 +115,7 @@ Clipboard::processMessage(UINT msg, WPARAM wParam, LPARAM lParam) {
if (!clipdata) {
notifier->notifyClipboardChanged(0, 0);
} else {
- CharArray unix_text;
- unix_text.buf = dos2unix(clipdata);
+ CharArray unix_text(convertLF(clipdata, strlen(clipdata)));
removeNonISOLatin1Chars(unix_text.buf);
notifier->notifyClipboardChanged(unix_text.buf, strlen(unix_text.buf));
}