shithub: Nail

Download patch

ref: 3dfdd6d6c595da74ac627548a9f7e939ab039ab7
parent: 2b54d6316b99adc8738f08281eda81aa690ea781
author: Ori Bernstein <ori@eigenstate.org>
date: Sun Jan 24 01:23:22 EST 2021

mesg view: copy over suffix in attachment name

When plumbing, this gives the plumber more to go off.
Upasfs ignores anything after the . and treats it the
same as the body.

--- a/mesg.c
+++ b/mesg.c
@@ -234,7 +234,7 @@
 static int
 mesgshow(Mesg *m)
 {
-	char *path, *home, *name;
+	char *path, *home, *name, *suff;
 	Biobuf *rfd, *wfd;
 	Mesg *a;
 	int i;
@@ -286,7 +286,9 @@
 		name = a->filename;
 		if(name == nil)
 			name = "body";
-		Bprint(wfd, "\tcp %s%sbody %s/%s\n", mbox.path, a->name, home, name);
+		if((suff = strchr(name, '.')) == nil)
+			suff = "";
+		Bprint(wfd, "\tcp %s%sbody%s %s/%s\n", mbox.path, a->name, suff, home, name);
 		continue;
 	}
 	Bterm(wfd);