tFix handling of empty (failed) dir items - sacc - sacc(omys), simple console gopher client (mirror)
 (HTM) git clone https://git.parazyd.org/sacc
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
 (DIR) commit 4dff6dde00bd2e8062f678d6ca2207d00119474f
 (DIR) parent f4d2323a6ee66f698e6f1b0611bd3beb04761330
 (HTM) Author: Quentin Rameau <quinq@fifth.space>
       Date:   Thu,  6 Jul 2017 13:36:08 +0200
       
       Fix handling of empty (failed) dir items
       
       Diffstat:
         M sacc.c                              |       7 +++++--
       
       1 file changed, 5 insertions(+), 2 deletions(-)
       ---
 (DIR) diff --git a/sacc.c b/sacc.c
       t@@ -232,8 +232,10 @@ molddiritem(char *raw)
                        }
                }
        
       -        if (!items)
       +        if (!items) {
       +                free(dir);
                        return NULL;
       +        }
        
                dir->items = items;
                dir->nitems = nitems;
       t@@ -383,7 +385,8 @@ delve(Item *hole)
                                displaytextitem(hole);
                                break;
                        case '1':
       -                        entry = hole;
       +                        if (hole->dir)
       +                                entry = hole;
                                break;
                        case 0:
                                fprintf(stderr, "Couldn't get %s:%s/%c%s\n", hole->host,