diff options
author | Arun Prakash Jana <engineerarun@gmail.com> | 2017-06-21 09:49:02 +0530 |
---|---|---|
committer | Arun Prakash Jana <engineerarun@gmail.com> | 2017-06-21 09:49:02 +0530 |
commit | f59cd3e90f6ca291d55c11149df99fef15cc1c98 (patch) | |
tree | 508f17f15168d48a2ce12ecd48a0d0a4f490a56d | |
parent | 3da053cbfaae10fc251d637a64c45814dd0eb935 (diff) | |
download | nnn-f59cd3e90f6ca291d55c11149df99fef15cc1c98.tar.gz |
Minor changes
-rw-r--r-- | nnn.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -436,11 +436,11 @@ spawn(char *file, char *arg1, char *arg2, char *dir, uchar flag) static char * xgetenv(char *name, char *fallback) { - char *value; - if (name == NULL) return fallback; - value = getenv(name); + + char *value = getenv(name); + return value && value[0] ? value : fallback; } @@ -1683,9 +1683,9 @@ redraw(char *path) static void browse(char *ipath, char *ifilter) { - static char path[PATH_MAX], oldpath[PATH_MAX], newpath[PATH_MAX]; - static char lastdir[PATH_MAX]; - static char fltr[LINE_MAX]; + char path[PATH_MAX], oldpath[PATH_MAX], newpath[PATH_MAX]; + char lastdir[PATH_MAX]; + char fltr[LINE_MAX]; char *mime, *dir, *tmp, *run, *env; struct stat sb; int r, fd, presel; @@ -2317,7 +2317,7 @@ main(int argc, char *argv[]) { char cwd[PATH_MAX], *ipath; char *ifilter, *bmstr; - int opt = 0; + int opt; /* Confirm we are in a terminal */ if (!isatty(0) || !isatty(1)) { |