tPrint a nicer index - sacc - sacc (saccomys): simple gopher client. | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit 7c51190b04aa8df983283f7b50edb70faa893d7a | |
parent 4691af5361b43138f257b19b23c89199cff210dc | |
Author: Quentin Rameau <[email protected]> | |
Date: Fri, 23 Jun 2017 20:39:30 +0200 | |
Print a nicer index | |
Diffstat: | |
sacc.c | 14 +++++++++----- | |
1 file changed, 9 insertions(+), 5 deletions(-) | |
--- | |
diff --git a/sacc.c b/sacc.c | |
t@@ -178,11 +178,15 @@ display(Item *item) | |
ndigits = (nitems < 10) ? 1 : (nitems < 100) ? 2 : 3; | |
for (i = item->printoff; i < nitems && i < lines; ++i) { | |
- item = items[i]; | |
- printf("%*d %-4s%c %s\n", ndigits, i+1, | |
- item->type != 'i' ? typedisplay(item->type) : "… | |
- item->type > '1' ? '|' : '+', | |
- items[i]->username); | |
+ if (item = items[i]) { | |
+ printf("%*d %-4s%c %s\n", ndigits, i+1, | |
+ item->type != 'i' ? | |
+ typedisplay(item->type) : "", | |
+ item->type > '1' ? '|' : '+', | |
+ items[i]->username); | |
+ } else { | |
+ printf("%*d !! |\n", ndigits, i+1); | |
+ } | |
} | |
break; | |
} |