path: root/bin/oii.mi5
diff options
authorTom Ryder <tom@sanctum.geek.nz>2017-11-11 01:07:14 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-11-11 01:07:14 +1300
commitaaf04871d944646225875d5e9cc31a967947c3fe (patch)
tree787efb73dabb6b9cda660ccde51e838b507a3dbd /bin/oii.mi5
parent247b816a891162fe28b5e2f8a675435efbd71a12 (diff)
parentca7f441951b85595969eb0842f90784502fc2cc7 (diff)
downloaddotfiles-0.13.0.tar.gz (sig)
Merge branch 'release/v0.13.0'v0.13.0
* release/v0.13.0: (30 commits) Bump version number to 0.13.0 Move mutt_mail.vim line select logic into plugin Add new mail_mutt.vim plugin, apply mappings Sort 'shortmess' flag settings alphabetically Add 'o' and 'O' back into 'shortmess' Set up individual flags for 'shortmess' Fix oii(1df) so it works as a pipe Use exists+ test rather than exists& Adjust some whitespace and comment layout Move matchit.vim sourcing into plugin.vim Rename netrw.vim to plugin.vim Remove 'shellslash' setting Move fedora.vim into os.vim Remove 'tildeop' setting Rearrange three smaller files into display.vim Move 'paste' options into terminal.vim Move wildmenu config into completion.vim Rename complete.vim to completion.vim Rename term.vim to terminal.vim Rename yank.vim to registers.vim ...
Diffstat (limited to 'bin/oii.mi5')
1 files changed, 7 insertions, 6 deletions
diff --git a/bin/oii.mi5 b/bin/oii.mi5
index 51f37fb4..914d45f9 100644
--- a/bin/oii.mi5
+++ b/bin/oii.mi5
@@ -11,9 +11,10 @@ fi
-# There is probably a way better way to do this than writing the whole file to
-# disk and then reading it off again, but until I think of something better,
-# this works and is byte-safe.
-cat - > "$td"/in
-[ -s "$td"/in ] || exit
-"$@" < "$td"/in
+# Read up to one byte and save it into temp file; discard stderr (stats)
+dd bs=1 count=1 of="$tf" 2>/dev/null
+# If there's now a byte in the file, spit it and the rest of the input into the
+# requested command
+[ -s "$tf" ] && cat -- "$tf" - | "$@"