aboutsummaryrefslogtreecommitdiffstats
path: root/src/nnn.c
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-01-24 21:16:37 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-01-24 21:16:37 +0530
commit5e5ca2fc951471440db1cdcae87e54b65c5e4846 (patch)
tree04c119ba8f3b50ea12201c26adcf787ae7210f0d /src/nnn.c
parent278280a7410fe57ecc7979ab5cb4ea90c1b2c358 (diff)
downloadnnn-5e5ca2fc951471440db1cdcae87e54b65c5e4846.tar.gz
Remove extra loop
Diffstat (limited to 'src/nnn.c')
-rw-r--r--src/nnn.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/nnn.c b/src/nnn.c
index bf7264e..65bfb10 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -2293,16 +2293,13 @@ static bool show_help(char *path)
start = end = helpstr;
while (*end) {
- while (*end != '\n')
- ++end;
-
- if (start == end) {
- ++end;
- continue;
+ if (*end == '\n') {
+ dprintf(fd, "%*c%.*s",
+ xchartohex(*start), ' ', (int)(end - start), start + 1);
+ start = end + 1;
}
- dprintf(fd, "%*c%.*s", xchartohex(*start), ' ', (int)(end - start), start + 1);
- start = ++end;
+ ++end;
}
dprintf(fd, "\nVOLUME: %s of ", coolsize(get_fs_info(path, FREE)));