diff options
author | Oskar <[email protected]> | 2024-04-19 23:18:03 +0200 |
---|---|---|
committer | Oskar <[email protected]> | 2024-04-19 23:18:03 +0200 |
commit | 73b0414254e6b888656b4e5346292f27b67ac9d9 (patch) | |
tree | 1427052e0515364278638d270755d213768d45c4 /editmode.c | |
parent | 645a02d84b174376beed51de9e8820fe4d217ede (diff) |
Added a way for the program to check if file exists or not. If not then
it creates it. If changes are made to the file like writing newlines
or edits from editmode is written then it will create the file.
Diffstat (limited to 'editmode.c')
-rw-r--r-- | editmode.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -6,6 +6,8 @@ #include "7ed.h" #include <stdint.h> +extern uint8_t new; + int delete_specified_newline(char filename[], long focus) { // special version of write_line that does as the name says char *line; @@ -277,6 +279,7 @@ int editmode(char filename[], uint64_t focus) { // the editing interface return 0; } + new = 0; size_t editbuffer_size = strlen(editbuffer); write_line(filename, focus, editbuffer, editbuffer_size); |