ref: 06dd182695dfee1549dfa2c6da0ce54edf198ef0
parent: d010b87b1814a3bf4df3f13d0c4131fbd885b270
author: ftrvxmtrx <[email protected]>
date: Tue Oct 18 17:25:19 EDT 2016
sam: revert showdata crap
--- a/sys/src/cmd/samterm/plan9.c
+++ b/sys/src/cmd/samterm/plan9.c
@@ -184,8 +184,8 @@
plumbformat(int i)
{
Plumbmsg *m;
- char *addr, *data, *act, *s;
- int n, replaced;
+ char *addr, *data, *act;
+ int n;
data = (char*)plumbbuf[i].data;
m = plumbunpack(data, plumbbuf[i].n);
@@ -197,36 +197,6 @@
return 0;
}
act = plumblookup(m->attr, "action");
-
- if(act != nil && strcmp(act, "showdata") == 0){
- addr = plumblookup(m->attr, "filename");
- n = sprint(data, "B \n");
- if(addr != nil)
- n += sprint(data+n, "f %s\n", addr);
- n += sprint(data+n, "c\n");
- s = memmove(data+n, m->data, m->ndata);
- s--;
- n += m->ndata;
- if(data[n-1] != '\n')
- data[n++] = '\n';
- data[n] = 0;
- replaced = 0;
- for(;;){
- s = strstr(s, "\n.\n");
- if(s == nil)
- break;
- s[1] = '';
- s += 2;
- replaced = 1;
- }
- n += sprint(data+n, ".\n");
- if(replaced)
- n += sprint(data+n, ",s/^$/./g\n");
- plumbbuf[i].n = n;
- plumbfree(m);
- return 1;
- }
-
if(act!=nil && strcmp(act, "showfile")!=0){
/* can't handle other cases yet */
plumbfree(m);