From 9188b14094ecb36fbea9ecdfe6247342a962e7d2 Mon Sep 17 00:00:00 2001 From: "Sean E. Russell" Date: Sat, 7 Mar 2020 08:30:33 -0600 Subject: Safety: prevent uninitialized variable use Record change Fixes changelog --- CHANGELOG.md | 8 ++++++++ colorschemes/registry.go | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e5b2dc..72af996 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 > - **Fixed**: for any bug fixes. > - **Security**: in case of vulnerabilities. +## [3.5.1] - ?? + +### Fixed + +- Removes verbose debugging unintentionally left in the code. +- kitchensink referenced by, but not included in binary is now included. +- Safety check prevents uninitialized colorscheme registry use + ## [3.5.0] - 2020-03-06 The version jump from 3.3.x is due to some work in the build automation that necessitated a number of bumps to test the build/release, and testing compiling plugins from github repositories. diff --git a/colorschemes/registry.go b/colorschemes/registry.go index 97e2bb0..d79271d 100644 --- a/colorschemes/registry.go +++ b/colorschemes/registry.go @@ -9,6 +9,12 @@ import ( var registry map[string]Colorscheme +func init() { + if registry == nil { + registry = make(map[string]Colorscheme) + } +} + func FromName(confDir string, c string) (Colorscheme, error) { cs, ok := registry[c] if !ok { -- cgit v1.2.3