From a9dacf10cebd0662a1f2febdfb5c9b52bf77f473 Mon Sep 17 00:00:00 2001 From: Tiago Cunha Date: Thu, 18 Feb 2010 12:36:18 +0000 Subject: [PATCH] Sync OpenBSD patchset 645: Don't strip add newline if only copying part of wrapped line. Problem spotted by and fix from Micah Cowan. --- window-copy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/window-copy.c b/window-copy.c index ac370490..c84b7d9b 100644 --- a/window-copy.c +++ b/window-copy.c @@ -1,4 +1,4 @@ -/* $Id: window-copy.c,v 1.102 2010-02-18 12:35:16 tcunha Exp $ */ +/* $Id: window-copy.c,v 1.103 2010-02-18 12:36:18 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -1038,7 +1038,7 @@ window_copy_copy_line(struct window_pane *wp, } /* Only add a newline if the line wasn't wrapped. */ - if (!wrapped) { + if (!wrapped || ex != xx) { *buf = xrealloc(*buf, 1, (*off) + 1); (*buf)[(*off)++] = '\n'; }