Introduce the GET_CONFIG IPC request
This introduces memory usage by one copy of the config file, which is an acceptable trade-off for being able to easily revert data loss. The default config is 6KB, user configs will be in the same ballpark. fixes #2856
This commit is contained in:
@ -898,6 +898,11 @@ bool parse_file(const char *f, bool use_nagbar) {
|
||||
if ((fstr = fdopen(fd, "r")) == NULL)
|
||||
die("Could not fdopen: %s\n", strerror(errno));
|
||||
|
||||
FREE(current_config);
|
||||
current_config = scalloc(stbuf.st_size + 1, 1);
|
||||
fread(current_config, 1, stbuf.st_size, fstr);
|
||||
rewind(fstr);
|
||||
|
||||
while (!feof(fstr)) {
|
||||
if (!continuation)
|
||||
continuation = buffer;
|
||||
|
Reference in New Issue
Block a user