commit 408fd866df1036c0a51e58a2029dc9c1f41e979c
parent bb8924f35719c580e9fa543a4cbea1258f764acf
Author: Quentin Rameau <quinq@fifth.space>
Date: Mon, 20 Aug 2018 12:02:35 +0200
Download non-interactive and unknown types with not term output
Diffstat:
sacc.c | | | 21 | ++++++++++++++++++++- |
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/sacc.c b/sacc.c
@@ -769,10 +769,12 @@ searchitem(Item *entry, Item *item)
static void
printout(Item *hole)
{
+ char t;
+
if (!hole)
return;
- switch (hole->redtype ? hole->redtype : hole->type) {
+ switch (hole->redtype ? hole->redtype : (t = hole->type)) {
case '0':
if (dig(hole, hole))
fputs(hole->raw, stdout);
@@ -780,7 +782,24 @@ printout(Item *hole)
case '1':
if (dig(hole, hole))
printdir(hole);
+ return;
default:
+ if (t >= '0' && t <= 'Z') {
+ diag("Type %c (%s) not supported", t, typedisplay(t));
+ return;
+ }
+ case '4':
+ case '5':
+ case '6':
+ case '9':
+ case 'g':
+ case 'I':
+ download(hole, 1);
+ case '2':
+ case '3':
+ case '7':
+ case '8':
+ case 'T':
return;
}
}