]> git.mdlowis.com Git - projs/tide.git/commitdiff
Added support for loading buffer contents from stdin and added an xman script for...
authorMike Lowis <mike.lowis@gentex.com>
Wed, 5 Oct 2016 16:17:24 +0000 (12:17 -0400)
committerMike Lowis <mike.lowis@gentex.com>
Wed, 5 Oct 2016 16:17:24 +0000 (12:17 -0400)
buf.c
xman [new file with mode: 0755]

diff --git a/buf.c b/buf.c
index 466a03136a9454e61aa3e064daed4a96f0b1831d..b3c8fc2db1390e9c911629b92e15b92cfd75a36a 100644 (file)
--- a/buf.c
+++ b/buf.c
@@ -10,7 +10,7 @@ int fpeekc(FILE* fin) {
 void buf_load(Buf* buf, char* path)
 {
     unsigned i = 0;
-    FILE* in = fopen(path, "rb");
+    FILE* in = (!strcmp(path,"-") ? stdin : fopen(path, "rb"));
     while (EOF != fpeekc(in)) {
         size_t len = 0;
         Rune r = 0;
diff --git a/xman b/xman
new file mode 100755 (executable)
index 0000000..ba060ba
--- /dev/null
+++ b/xman
@@ -0,0 +1,2 @@
+#!/bin/sh
+man -P cat "$@" | fmt | ./edit -