Skip to content

Commit

Permalink
fix order of loading schema files in dyncfg_get_schema_from (netdata#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyam8 authored Jun 6, 2024
1 parent f826bbf commit 129ded6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/daemon/config/dyncfg-files.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,12 @@ static bool dyncfg_read_file_to_buffer(const char *filename, BUFFER *dst) {
static bool dyncfg_get_schema_from(const char *dir, const char *id, BUFFER *dst) {
char filename[FILENAME_MAX + 1];

snprintfz(filename, sizeof(filename), "%s/schema.d/%s.json", dir, id);
CLEAN_CHAR_P *escaped_id = dyncfg_escape_id_for_filename(id);
snprintfz(filename, sizeof(filename), "%s/schema.d/%s.json", dir, escaped_id);
if(dyncfg_read_file_to_buffer(filename, dst))
return true;

CLEAN_CHAR_P *escaped_id = dyncfg_escape_id_for_filename(id);
snprintfz(filename, sizeof(filename), "%s/schema.d/%s.json", dir, escaped_id);
snprintfz(filename, sizeof(filename), "%s/schema.d/%s.json", dir, id);
if(dyncfg_read_file_to_buffer(filename, dst))
return true;

Expand Down

0 comments on commit 129ded6

Please sign in to comment.