VirtualBox

Changeset 104761 in vbox


Ignore:
Timestamp:
May 22, 2024 2:46:08 PM (10 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
163328
Message:

Shared Clipboard: Attempt to prevent extra new lines when copying text from Linux to Windows (simplify fix), bugref:10694.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/SharedClipboard/clipboard-common.cpp

    r104760 r104761  
    942942            /* Insert '\r' in front of '\n', but avoid '\r\r\n' situations
    943943               because it will result in extra empty lines on the other side. */
    944             if (   i == 0
    945                 || (   i > 1
    946                     && pcwszSrc[i - 1] != VBOX_SHCL_CARRIAGERETURN
    947                    )
    948                )
    949             {
    950                 pu16Dst[j] = VBOX_SHCL_CARRIAGERETURN;
    951                 ++j;
    952             }
     944            if (i == 0 || pcwszSrc[i - 1] != VBOX_SHCL_CARRIAGERETURN)
     945                pu16Dst[j++] = VBOX_SHCL_CARRIAGERETURN;
    953946
    954947            /* Not enough space in destination? */
     
    964957        {
    965958            /* Set CR.r, but avoid '\r\r'. */
    966             if (   i == 0
    967                 || (   i > 1
    968                     && pcwszSrc[i - 1] != VBOX_SHCL_CARRIAGERETURN
    969                    )
    970                )
    971             {
    972                 pu16Dst[j] = VBOX_SHCL_CARRIAGERETURN;
    973                 ++j;
    974             }
     959            if (i == 0 || pcwszSrc[i - 1] != VBOX_SHCL_CARRIAGERETURN)
     960                pu16Dst[j++] = VBOX_SHCL_CARRIAGERETURN;
    975961
    976962            /* Not enough space in destination? */
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette