diff options
| author | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-01-27 22:25:38 +0100 |
|---|---|---|
| committer | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-01-27 22:25:38 +0100 |
| commit | 661adbfbd282568dca144bf7ec39c3fbbda80d90 (patch) | |
| tree | 61853d85675c21cf5a08dd013a749734f125f890 /src | |
| parent | ba29d86226e276bedd1f6f1623d32652df7f3205 (diff) | |
Escape chars when debugging
Diffstat (limited to 'src')
| -rw-r--r-- | src/middleware/find_mailboxes_compatibility.rs | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/middleware/find_mailboxes_compatibility.rs b/src/middleware/find_mailboxes_compatibility.rs index 0e4b2cd..ddc12f1 100644 --- a/src/middleware/find_mailboxes_compatibility.rs +++ b/src/middleware/find_mailboxes_compatibility.rs @@ -24,7 +24,11 @@ impl Middleware for FindMailboxesCompatibility { // We'll need to convert the LIST to a FIND self.tags.push(tag.trim().to_string()); let replacement = format!("{} LIST \"\" \"*\"\r\n", tag.trim()); - debug!("### {replacement}"); + let debug_str = replacement + .replace('\n', "\\n") + .replace('\r', "\\r") + .replace('\t', "\\t"); + debug!("### {debug_str}"); return replacement.into_bytes(); } } @@ -63,6 +67,13 @@ impl Middleware for FindMailboxesCompatibility { }) .collect(); - lines.join("\n").into_bytes() + let replacement = lines.join("\n"); + let debug_str = replacement + .replace('\n', "\\n") + .replace('\r', "\\r") + .replace('\t', "\\t"); + debug!("### {debug_str}"); + + replacement.into_bytes() } } |