noice

small file browser
git clone git://git.2f30.org/noice.git
Log | Files | Refs | README | LICENSE

commit 7ceda4f7d2916c0123aacea8005fc39cd8c04d02
parent d1ed0cff118a07327b3b237ea65836f5c673acbb
Author: sin <sin@2f30.org>
Date:   Thu, 26 Nov 2015 13:42:41 +0000

Declare var at top of block

Diffstat:
noice.c | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/noice.c b/noice.c @@ -198,12 +198,12 @@ spawn(const char *file, const char *arg, const char *dir) char * xgetenv(char *name, char *fallback) { + char *value; + if (name == NULL) return fallback; - char *value = getenv(name); - if (value) - return value; - return fallback; + value = getenv(name); + return value ? value : fallback; } char *