summaryrefslogtreecommitdiffstats
path: root/src/fileio.c
diff options
context:
space:
mode:
author=?UTF-8?q?Dundar=20G=C3=B6c?= <gocdundar@gmail.com>2022-04-07 13:26:34 +0100
committerBram Moolenaar <Bram@vim.org>2022-04-07 13:26:34 +0100
commitf26c16144ddb27642c09f2cf5271afd163b36306 (patch)
treed4cfbbd4b403ba63982435b61a41fa71755f1716 /src/fileio.c
parentcb49a1d934d38cbc0d445af59b71ffe45cbcae75 (diff)
patch 8.2.4704: using "else" after return or break increases indentv8.2.4704
Problem: Using "else" after return or break increases indent. Solution: Remove "else" and reduce indent. (Goc Dundar, closes #10099)
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c43
1 files changed, 21 insertions, 22 deletions
diff --git a/src/fileio.c b/src/fileio.c
index af915c665f..439789e598 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -1245,30 +1245,29 @@ retry:
read_buf_col += n;
break;
}
- else
+
+ // Append whole line and new-line. Change NL
+ // to NUL to reverse the effect done below.
+ for (ni = 0; ni < n; ++ni)
{
- // Append whole line and new-line. Change NL
- // to NUL to reverse the effect done below.
- for (ni = 0; ni < n; ++ni)
- {
- if (p[ni] == NL)
- ptr[tlen++] = NUL;
- else
- ptr[tlen++] = p[ni];
- }
- ptr[tlen++] = NL;
- read_buf_col = 0;
- if (++read_buf_lnum > from)
- {
- // When the last line didn't have an
- // end-of-line don't add it now either.
- if (!curbuf->b_p_eol)
- --tlen;
- size = tlen;
- eof = TRUE;
- break;
- }
+ if (p[ni] == NL)
+ ptr[tlen++] = NUL;
+ else
+ ptr[tlen++] = p[ni];
}
+ ptr[tlen++] = NL;
+ read_buf_col = 0;
+ if (++read_buf_lnum > from)
+ {
+ // When the last line didn't have an
+ // end-of-line don't add it now either.
+ if (!curbuf->b_p_eol)
+ --tlen;
+ size = tlen;
+ eof = TRUE;
+ break;
+ }
+
}
}
}