about summary refs log tree commit diff
path: root/pkgs/profpatsch/nman
diff options
context:
space:
mode:
authorsternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org>2021-02-12 18:48:37 +0100
committersternenseemann <sternenseemann@systemli.org>2021-02-25 19:52:33 +0100
commitfda10cb43ce79a332ccd61f9ee59a60c544c56fc (patch)
tree2d180473da3f3fff4d353516cbb4b3d00f2d7fec /pkgs/profpatsch/nman
parentfcf24459e0c7fb072e77f3416ff27881c4c58f2e (diff)
pkgs/profpatsch/nman: check for newline before trimming
Diffstat (limited to 'pkgs/profpatsch/nman')
-rw-r--r--pkgs/profpatsch/nman/nman.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkgs/profpatsch/nman/nman.rs b/pkgs/profpatsch/nman/nman.rs
index 77086b87..048469d7 100644
--- a/pkgs/profpatsch/nman/nman.rs
+++ b/pkgs/profpatsch/nman/nman.rs
@@ -30,7 +30,10 @@ fn mktemp(suffix: &str) -> std::io::Result<TempDir> {
 
     if mktemp.status.success() {
         // remove trailing newline
-        mktemp.stdout.pop();
+        if mktemp.stdout.ends_with(b"\n") {
+            mktemp.stdout.pop();
+        }
+
         Ok(TempDir {
             inner: mktemp.stdout
         })