projects
/
profile
/
ivi
/
weston.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
340a434
)
terminal: Insert newlines when copying multiple lines
author
Kristian Høgsberg
<krh@bitplanet.net>
Mon, 2 Jul 2012 01:25:41 +0000
(21:25 -0400)
committer
Kristian Høgsberg
<krh@bitplanet.net>
Mon, 2 Jul 2012 01:25:41 +0000
(21:25 -0400)
clients/terminal.c
patch
|
blob
|
history
diff --git
a/clients/terminal.c
b/clients/terminal.c
index
62bb020
..
504e3c2
100644
(file)
--- a/
clients/terminal.c
+++ b/
clients/terminal.c
@@
-849,7
+849,12
@@
terminal_send_selection(struct terminal *terminal, int fd)
if (!attr.attr.s)
continue;
len = strnlen((char *) p_row[col].byte, 4);
- fwrite(p_row[col].byte, 1, len, fp);
+ if (len > 0)
+ fwrite(p_row[col].byte, 1, len, fp);
+ if (len == 0 || col == terminal->width - 1) {
+ fwrite("\n", 1, 1, fp);
+ break;
+ }
}
}
fclose(fp);