From a4480b95231ab8646348e64ee16ede1372776c00 Mon Sep 17 00:00:00 2001 From: yorhel Date: Sat, 2 Aug 2008 13:43:39 +0000 Subject: [PATCH] Got rid of the FF_PAR hack git-svn-id: svn://blicky.net/ncdu/trunk@35 ce56bc8d-f834-0410-b703-f827bd498a76 --- src/browser.c | 5 ++--- src/ncdu.h | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/browser.c b/src/browser.c index 4a39db3..5c0229d 100644 --- a/src/browser.c +++ b/src/browser.c @@ -135,7 +135,7 @@ char *graph(off_t max, off_t size) { #define exlhid(x) if(bflags & BF_HIDE && (\ - (!(x->flags & FF_PAR) && (x->name[0] == '.' || x->name[strlen(x->name)-1] == '~'))\ + (x != &ref && (x->name[0] == '.' || x->name[strlen(x->name)-1] == '~'))\ || x->flags & FF_EXL)\ ) { i--; continue; } @@ -183,7 +183,6 @@ void drawBrowser(int change) { /* add reference to parent dir */ memset(&ref, 0, sizeof(struct dir)); if(bcur->parent->parent) { - ref.flags |= FF_PAR; ref.name = ".."; ref.next = bcur; ref.parent = bcur->parent; @@ -242,7 +241,7 @@ void drawBrowser(int change) { attron(A_REVERSE); /* reference to parent dir has a different format */ - if(n->flags & FF_PAR) { + if(n == &ref) { mvhline(i+2, 0, ' ', wincols); o = bgraph == 0 ? 11 : bgraph == 1 ? 23 : diff --git a/src/ncdu.h b/src/ncdu.h index e6a06c7..a3ca959 100644 --- a/src/ncdu.h +++ b/src/ncdu.h @@ -98,7 +98,6 @@ #define FF_EXL 0x10 /* excluded using exlude patterns */ #define FF_SERR 0x20 /* error in subdirectory */ #define FF_BSEL 0x40 /* selected */ -#define FF_PAR 0x80 /* reference to parent directory (hack - only used in browser.c) */ /* Settings Flags (int sflags) */ #define SF_SMFS 0x01 /* same filesystem */