This commit is contained in:
Kartik K. Agaram 2021-12-17 11:37:34 -08:00
parent 166c8e0ca0
commit a617b3e5ac
1 changed files with 3 additions and 0 deletions

View File

@ -389,6 +389,9 @@ void save_to_current_definition_and_editor_buffer (lua_State *L, const char *def
}
/* I don't understand the best way to read all of a text file.
* I'm currently using fread, but its error handling is really designed for
* binary data containing fixed-size records. */
static void read_editor_buffer (char *out, int capacity) {
FILE *in = fopen("teliva_editor_buffer", "r");
fread(out, capacity, 1, in); /* TODO: handle overly large file */