From 960807278768862c2c331aeb9819966e42dd261c Mon Sep 17 00:00:00 2001 From: Florent Rougon Date: Mon, 22 Aug 2022 22:40:31 +0200 Subject: [PATCH] SGPath: make read_allowed_paths and write_allowed_paths static data members No functional change, only a tidier organization. --- simgear/misc/sg_path.cxx | 7 ++++--- simgear/misc/sg_path.hxx | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/simgear/misc/sg_path.cxx b/simgear/misc/sg_path.cxx index 87803721..f611bf4a 100644 --- a/simgear/misc/sg_path.cxx +++ b/simgear/misc/sg_path.cxx @@ -53,9 +53,10 @@ using std::string; using simgear::strutils::starts_with; -// For SGPath::validate() -static string_list read_allowed_paths; -static string_list write_allowed_paths; +// Static data members used by SGPath::addAllowedPathPattern(), +// SGPath::validate(), etc. +string_list SGPath::read_allowed_paths; +string_list SGPath::write_allowed_paths; /** * define directory path separators diff --git a/simgear/misc/sg_path.hxx b/simgear/misc/sg_path.hxx index 318d4450..1677ef3e 100644 --- a/simgear/misc/sg_path.hxx +++ b/simgear/misc/sg_path.hxx @@ -396,6 +396,10 @@ private: mutable bool _existsCached : 1; ///< only used on Windows mutable time_t _modTime; mutable size_t _size; + + // For addAllowedPathPattern(), validate(), etc. + static string_list read_allowed_paths; + static string_list write_allowed_paths; }; // Other comparison operators are in the class definition block