diff options
author | Oskar <[email protected]> | 2024-04-20 16:27:55 +0200 |
---|---|---|
committer | Oskar <[email protected]> | 2024-04-20 16:27:55 +0200 |
commit | b3d8be14e12aca5993925c156da5eb76af88e665 (patch) | |
tree | 0e9f01bcce336ebdc6b53575f2e1d082a69313d3 /editmode.c | |
parent | a5b0a8dd423fd15d133645987f21a3e87f5fa606 (diff) |
Fixed issue where files with no lines dont work properly with 'N'
Diffstat (limited to 'editmode.c')
-rw-r--r-- | editmode.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -178,7 +178,13 @@ int new_line(char filename[], long long new_line_pos_temp, uint64_t amount_of_li fputc('\n', file); fputc('\n', file); fclose(file); - return 0; + + if(amount_of_lines == 1) { + return 0; + } + if(amount_of_lines > 1) { + amount_of_lines = amount_of_lines-1; + } } } |