commit 1c19f2d4f38a65604282d34368db449480776480
parent 0263b69e9c86181f759031c081cb24b48e36db0d
Author: Pavel Renev <an2qzavok@gmail.com>
Date: Tue, 22 Mar 2022 21:31:34 +0000
small fixes, Handler: bring back menu
Diffstat:
3 files changed, 14 insertions(+), 17 deletions(-)
diff --git a/extra/Gopher.c b/extra/Gopher.c
@@ -18,8 +18,13 @@ printtext(char *buf, long size)
Biobuf* bd;
long n;
bd = Bfdopen(1, OWRITE);
- for (n = 0; n < size; n++)
- if (buf[n] != '\r') Bputc(bd, buf[n]);
+ Bprint(bd, "f\nl\n" ".");
+ for (n = 0; n < size; n++) {
+ if (buf[n] == '\r') continue;
+ else if (buf[n] == '\n') Bprint(bd, "\n" "n\n" ".");
+ else Bputc(bd, buf[n]);
+ }
+ Bprint(bd, "\n");
}
void
diff --git a/extra/Handler b/extra/Handler
@@ -36,10 +36,7 @@ fn lmarkdown {
fn lgopher {
history = ($1 $history)
forward = ()
- switch ($1) {
- case *.md; Gopher $1 | Markdown
- case *; Gopher $1 > $rroot/text
- }
+ Gopher $1 > $rroot/text
}
fn tryfile {
@@ -85,11 +82,11 @@ fn link {
echo
}
-# cat > $rroot/menu <<EOF
-# ----
-# Back
-# Exit
-# EOF
+cat > $rroot/menu <<EOF
+----
+Back
+Exit
+EOF
if (test -n $"1) link $1
if not link `{pwd}
diff --git a/richterm.c b/richterm.c
@@ -161,9 +161,6 @@ threadmain(int argc, char **argv)
threadsetname("main");
- char initmenu[] = "test\n";
- arraygrow(menubuf, sizeof(initmenu), initmenu);
-
void *ov;
enum {MOUSE, RESIZE, REDRAW, INSERT, KBD, AEND};
@@ -674,9 +671,7 @@ Array *elems;
Array *richdata;
Elem *euser;
-char *sampledata =
- ".We richterm now\n"
- "n\n";
+char *sampledata = "";
char *
elemparse(Elem *e, char *str, long n)