From b93084200af564d200d6ea9585c6164aeab9c209 Mon Sep 17 00:00:00 2001 From: David Schmidt Date: Fri, 1 Feb 2013 14:24:59 +0000 Subject: [PATCH] Skip the leading return character when this is the first line in the paste buffer --- src/macdriver_generic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/macdriver_generic.c b/src/macdriver_generic.c index 83bb1c1..dc82a13 100755 --- a/src/macdriver_generic.c +++ b/src/macdriver_generic.c @@ -533,7 +533,9 @@ clipboard_paste(void) bufsize += CHUNK_SIZE + 1; expanding_buffer = realloc(expanding_buffer, bufsize); } - strcat((char*)expanding_buffer,"\r"); + /* Skip the leading return character when this is the first line in the paste buffer */ + if (strlen((char*)expanding_buffer) > 0) + strcat((char*)expanding_buffer,"\r"); strncat((char*)expanding_buffer,buffer,strlen(buffer)); g_clipboard = (char*)expanding_buffer; }