Make sure Copy > As Text and Copy > As CSV add a final newline.

Bug: 16214
Change-Id: Idb691c1fbb33b2fabca5726c159b1f754668c1ae
Reviewed-on: https://code.wireshark.org/review/35147
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2019-11-19 18:23:38 -08:00
parent 141e2ffcf0
commit 309bf5b547
1 changed files with 13 additions and 1 deletions

View File

@ -1966,8 +1966,20 @@ void MainWindow::actionEditCopyTriggered(MainWindow::CopySelected selection_type
content << entry;
}
if (content.count() > 0)
if (content.count() > 0) {
clip = content.join("\n");
//
// Each YAML item ends with a newline, so the string
// ends with a newline already if it's CopyListAsYAML.
// If we add a newline, there'd be an extra blank
// line.
//
// Otherwise, we've used newlines as separators, not
// terminators, so there's no final newline. Add it.
//
if (selection_type != CopyListAsYAML)
clip += "\n";
}
}
break;
}