mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 05:21:10 +00:00
Correctly aggregate together errors from nested config files (with
source-file). Fix by Thomas Adam, reported by Sam Livingstone-Gray
This commit is contained in:
11
cfg.c
11
cfg.c
@ -34,9 +34,10 @@
|
||||
void printflike2 cfg_print(struct cmd_ctx *, const char *, ...);
|
||||
void printflike2 cfg_error(struct cmd_ctx *, const char *, ...);
|
||||
|
||||
char *cfg_cause;
|
||||
int cfg_finished;
|
||||
struct causelist cfg_causes = ARRAY_INITIALIZER;
|
||||
char *cfg_cause;
|
||||
int cfg_finished;
|
||||
int cfg_references;
|
||||
struct causelist cfg_causes;
|
||||
|
||||
/* ARGSUSED */
|
||||
void printflike2
|
||||
@ -89,6 +90,8 @@ load_cfg(const char *path, struct cmd_ctx *ctxin, struct causelist *causes)
|
||||
}
|
||||
n = 0;
|
||||
|
||||
cfg_references++;
|
||||
|
||||
line = NULL;
|
||||
retval = CMD_RETURN_NORMAL;
|
||||
while ((buf = fgetln(f, &len))) {
|
||||
@ -171,6 +174,8 @@ load_cfg(const char *path, struct cmd_ctx *ctxin, struct causelist *causes)
|
||||
}
|
||||
fclose(f);
|
||||
|
||||
cfg_references--;
|
||||
|
||||
return (retval);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user