summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2013-02-27 09:22:27 +0100
committerAleksander Morgado <aleksander@lanedo.com>2013-06-18 09:24:06 +0200
commit99e3d072d6676d7a219594f05e0409b9eadd5a52 (patch)
tree323573473f32cd1fa60327e6501238b6a1e702ef
parent0828a34333e6a4af6a21436e408ec57ce620d170 (diff)
downloadgtk+-99e3d072d6676d7a219594f05e0409b9eadd5a52.tar.gz
win32: don't convert '\n' to '\r\n' when copying if it already is '\r\n'
https://bugzilla.gnome.org/show_bug.cgi?id=649390
-rw-r--r--gdk/win32/gdkproperty-win32.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdk/win32/gdkproperty-win32.c b/gdk/win32/gdkproperty-win32.c
index 9096729990..39163b52ba 100644
--- a/gdk/win32/gdkproperty-win32.c
+++ b/gdk/win32/gdkproperty-win32.c
@@ -206,7 +206,7 @@ gdk_property_change (GdkWindow *window,
wclen++; /* Terminating 0 */
size = wclen * 2;
for (i = 0; i < wclen; i++)
- if (wcptr[i] == '\n')
+ if (wcptr[i] == '\n' && (i == 0 || wcptr[i - 1] != '\r'))
size += 2;
if (!(hdata = GlobalAlloc (GMEM_MOVEABLE, size)))
@@ -223,7 +223,7 @@ gdk_property_change (GdkWindow *window,
p = (wchar_t *) ucptr;
for (i = 0; i < wclen; i++)
{
- if (wcptr[i] == '\n')
+ if (wcptr[i] == '\n' && (i == 0 || wcptr[i - 1] != '\r'))
*p++ = '\r';
*p++ = wcptr[i];
}