necouchman commented on code in PR #512:
URL: https://github.com/apache/guacamole-server/pull/512#discussion_r1696955807


##########
src/terminal/select.c:
##########
@@ -371,17 +371,31 @@ void guac_terminal_select_end(guac_terminal* terminal) {
     /* Otherwise, copy multiple rows */
     else {
 
+        /* Get last char of the row */
+        guac_terminal_buffer_row* buffer_row = 
guac_terminal_buffer_get_row(terminal->buffer, start_row, 0);
+
         /* Store first row */
         guac_terminal_clipboard_append_row(terminal, start_row, start_col, -1);
 
         /* Store all middle rows */
         for (int row = start_row + 1; row < end_row; row++) {
-            guac_common_clipboard_append(terminal->clipboard, "\n", 1);
+
+            /* Add a new line only if the line was not wrapped */
+            if (buffer_row->wrapped_row == false)
+                guac_common_clipboard_append(terminal->clipboard, "\n", 1);
+
+            /* Store middle row */
             guac_terminal_clipboard_append_row(terminal, row, 0, -1);
+
+            /* Update to last char of current row */
+            buffer_row = guac_terminal_buffer_get_row(terminal->buffer, row, 
0);

Review Comment:
   As above, how is this getting the last char of the current row? It seems to 
be to be getting the first char?



##########
src/terminal/select.c:
##########
@@ -371,17 +371,31 @@ void guac_terminal_select_end(guac_terminal* terminal) {
     /* Otherwise, copy multiple rows */
     else {
 
+        /* Get last char of the row */
+        guac_terminal_buffer_row* buffer_row = 
guac_terminal_buffer_get_row(terminal->buffer, start_row, 0);

Review Comment:
   I'm a bit confused by the comment, here - wouldn't this particular call get 
the _first_ character of the given row (index 0 of the row), not the last char 
of the row?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@guacamole.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to