Skip to content

Commit

Permalink
expand macros for non-existant custom variable as empty string
Browse files Browse the repository at this point in the history
Closes #983
  • Loading branch information
klaernie committed Aug 6, 2024
1 parent 9c23670 commit 0d70776
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Nagios Core 4 Change Log
------------------
* Fix inconsistent links for 'View {Trends,Alert Histogram} For This {Host,Service}' (Mauricio Faria de Oliveira)
* Fix broken links from removing AngularJS pages in 4.5.3 (Dylan Anderson)
* Expand the custom variable macros to an empty string, if the custom variable does not exist

4.5.3 - 2024-06-11
------------------
Expand Down
6 changes: 6 additions & 0 deletions common/macros.c
Original file line number Diff line number Diff line change
Expand Up @@ -2484,6 +2484,12 @@ int grab_custom_object_macro_r(nagios_macros *mac, char *macro_name, customvaria
}
}

/* expand nonexistant custom variables as an empty string */
if( result == ERROR ){
*output = "";
result = OK;
}

return result;
}

Expand Down

0 comments on commit 0d70776

Please sign in to comment.