Changeset 104773 in vbox for trunk/src/VBox
- Timestamp:
- May 24, 2024 12:56:32 PM (6 months ago)
- Location:
- trunk/src/VBox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/darwin/VBoxClient/VBoxClientClipboardGuestToHost.cpp
r100108 r104773 234 234 235 235 size_t cwcTmp; /* (includes a schwarzenegger character) */ 236 int rc = ShClUtf16 LFLenUtf8(pwszData, cbData / sizeof(RTUTF16), &cwcTmp);236 int rc = ShClUtf16CalcNormalizedEolToCRLFLength(pwszData, cbData / sizeof(RTUTF16), &cwcTmp); 237 237 AssertRCReturn(rc, rc); 238 238 -
trunk/src/VBox/GuestHost/SharedClipboard/clipboard-common.cpp
r104762 r104773 668 668 size_t cchDst; 669 669 670 int rc = ShClUtf16 LFLenUtf8(pcwszSrc, cwcSrc, &cchDst);670 int rc = ShClUtf16CalcNormalizedEolToCRLFLength(pcwszSrc, cwcSrc, &cchDst); 671 671 if (RT_SUCCESS(rc)) 672 672 { … … 838 838 } 839 839 840 int ShClUtf16 LFLenUtf8(PCRTUTF16 pcwszSrc, size_t cwSrc, size_t *pchLen)840 int ShClUtf16CalcNormalizedEolToCRLFLength(PCRTUTF16 pcwszSrc, size_t cwSrc, size_t *pchLen) 841 841 { 842 842 AssertPtrReturn(pcwszSrc, VERR_INVALID_POINTER); … … 856 856 { 857 857 /* Check for a single line feed */ 858 if (pcwszSrc[i] == VBOX_SHCL_LINEFEED) 858 if ( pcwszSrc[i] == VBOX_SHCL_LINEFEED 859 && (i == 0 || pcwszSrc[i - 1] != VBOX_SHCL_CARRIAGERETURN)) 860 { 859 861 ++cLen; 862 } 860 863 #ifdef RT_OS_DARWIN 861 864 /* Check for a single carriage return (MacOS) */ 862 if (pcwszSrc[i] == VBOX_SHCL_CARRIAGERETURN) 865 if ( pcwszSrc[i] == VBOX_SHCL_CARRIAGERETURN 866 && (i + 1 >= cwcSrc || pcwszSrc[i + 1] != VBOX_SHCL_LINEFEED)) 867 { 863 868 ++cLen; 869 } 864 870 #endif 865 871 if (pcwszSrc[i] == 0) -
trunk/src/VBox/HostServices/SharedClipboard/darwin-pasteboard.cpp
r103148 r104773 313 313 Assert(cwcSrc == RTUtf16Len(pwszSrc)); 314 314 size_t cwcDst = 0; 315 rc = ShClUtf16 LFLenUtf8(pwszSrc, cwcSrc, &cwcDst);315 rc = ShClUtf16CalcNormalizedEolToCRLFLength(pwszSrc, cwcSrc, &cwcDst); 316 316 if (RT_SUCCESS(rc)) 317 317 {
Note:
See TracChangeset
for help on using the changeset viewer.