1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-12-10 06:11:08 +01:00

Support multiline comments in ProducerOption.setComment().

This commit is contained in:
feri 2022-02-24 17:04:30 +01:00 committed by Paul Schaub
parent 53f7815778
commit 7a77d0847a
2 changed files with 17 additions and 5 deletions

View file

@ -76,7 +76,12 @@ public final class EncryptionStream extends OutputStream {
LOGGER.debug("Wrap encryption output in ASCII armor");
armorOutputStream = ArmoredOutputStreamFactory.get(outermostStream);
if (options.hasComment()) {
ArmorUtils.addCommentHeader(armorOutputStream, options.getComment());
String[] commentLines = options.getComment().split("\n");
for (String commentLine : commentLines) {
if (!commentLine.trim().isEmpty()) {
ArmorUtils.addCommentHeader(armorOutputStream, commentLine);
}
}
}
outermostStream = armorOutputStream;
}