|
@@ -37,21 +37,12 @@ int EncryptedStream::loadFile (const int fd) {
|
|
|
|
|
|
|
|
if (enc_flags & ENC_KEEP_NEWLINES) {
|
|
if (enc_flags & ENC_KEEP_NEWLINES) {
|
|
|
bd::String buf(in_buf), line, out_buf;
|
|
bd::String buf(in_buf), line, out_buf;
|
|
|
- /* terribly ineffecient, but this is used infrequently */
|
|
|
|
|
- while (buf.find('\n') != bd::String::npos) {
|
|
|
|
|
|
|
+ while (buf.length()) {
|
|
|
line = newsplit(buf, '\n');
|
|
line = newsplit(buf, '\n');
|
|
|
unapply_filters(line, enc_flags);
|
|
unapply_filters(line, enc_flags);
|
|
|
line += '\n';
|
|
line += '\n';
|
|
|
out_buf += line;
|
|
out_buf += line;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- /* Finish the rest off */
|
|
|
|
|
- if (buf.length()) {
|
|
|
|
|
- line = buf;
|
|
|
|
|
- unapply_filters(line, enc_flags);
|
|
|
|
|
- line += '\n';
|
|
|
|
|
- out_buf += line;
|
|
|
|
|
- }
|
|
|
|
|
in_buf = out_buf;
|
|
in_buf = out_buf;
|
|
|
} else {
|
|
} else {
|
|
|
unapply_filters(in_buf, enc_flags);
|
|
unapply_filters(in_buf, enc_flags);
|
|
@@ -95,22 +86,13 @@ int EncryptedStream::writeFile (const int fd, const char enc_flags) const {
|
|
|
|
|
|
|
|
if (enc_flags & ENC_KEEP_NEWLINES) {
|
|
if (enc_flags & ENC_KEEP_NEWLINES) {
|
|
|
bd::String buf(str), line;
|
|
bd::String buf(str), line;
|
|
|
- /* terribly ineffecient, but this is used infrequently */
|
|
|
|
|
- while (buf.find('\n') != bd::String::npos) {
|
|
|
|
|
|
|
+ while (buf.length()) {
|
|
|
line = newsplit(buf, '\n');
|
|
line = newsplit(buf, '\n');
|
|
|
apply_filters(line, enc_flags);
|
|
apply_filters(line, enc_flags);
|
|
|
line += '\n';
|
|
line += '\n';
|
|
|
out_buf += line;
|
|
out_buf += line;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /* Finish the rest off */
|
|
|
|
|
- if (buf.length()) {
|
|
|
|
|
- line = buf;
|
|
|
|
|
- apply_filters(line, enc_flags);
|
|
|
|
|
- line += '\n';
|
|
|
|
|
- out_buf += line;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
} else {
|
|
} else {
|
|
|
out_buf = str;
|
|
out_buf = str;
|
|
|
apply_filters(out_buf, enc_flags);
|
|
apply_filters(out_buf, enc_flags);
|