66d46ed8ed
First, I tried reusing the existing ExpandEnvironmentVariableStrings() helper in TerminalApp/CascadiaSettings.cpp, but then I realized that WIL already provides its own wrapper for ExpandEnvironmentStrings(), so instead I deleted ExpandEnvironmentVariableStrings() and replaced its usages with wil::ExpandEnvironmentStringsW(). I then used wil::ExpandEnvironmentStringsW() when resolving the icon path as well. In addition, to allow empty strings, I made changes to treat empty strings for "icon" the same as JSON `null` or not setting the property at all. Co-Authored-By: Michael Niksa <miniksa@microsoft.com>
75 lines
1.4 KiB
C++
75 lines
1.4 KiB
C++
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT license.
|
|
|
|
// clang-format off
|
|
|
|
#pragma once
|
|
|
|
|
|
#pragma warning(push)
|
|
|
|
// C
|
|
#include <climits>
|
|
#include <cwchar>
|
|
#include <cwctype>
|
|
|
|
// STL
|
|
|
|
// Block minwindef.h min/max macros to prevent <algorithm> conflict
|
|
#define NOMINMAX
|
|
|
|
#include <algorithm>
|
|
#include <atomic>
|
|
#include <deque>
|
|
#include <list>
|
|
#include <memory>
|
|
#include <map>
|
|
#include <mutex>
|
|
#include <shared_mutex>
|
|
#include <new>
|
|
#include <optional>
|
|
#include <queue>
|
|
#include <stdexcept>
|
|
#include <string>
|
|
#include <thread>
|
|
#include <tuple>
|
|
#include <utility>
|
|
#include <vector>
|
|
#include <unordered_map>
|
|
#include <iterator>
|
|
#include <math.h>
|
|
#include <sstream>
|
|
#include <fstream>
|
|
#include <iomanip>
|
|
#include <filesystem>
|
|
#include <functional>
|
|
|
|
// WIL
|
|
#include <wil/Common.h>
|
|
#include <wil/Result.h>
|
|
#include <wil/resource.h>
|
|
#include <wil/wistd_memory.h>
|
|
#include <wil/stl.h>
|
|
#include <wil/com.h>
|
|
#include <wil/filesystem.h>
|
|
|
|
// GSL
|
|
// Block GSL Multi Span include because it both has C++17 deprecated iterators
|
|
// and uses the C-namespaced "max" which conflicts with Windows definitions.
|
|
#define GSL_MULTI_SPAN_H
|
|
#include <gsl/gsl>
|
|
|
|
// CppCoreCheck
|
|
#include <CppCoreCheck/Warnings.h>
|
|
|
|
// IntSafe
|
|
#define ENABLE_INTSAFE_SIGNED_FUNCTIONS
|
|
#include <intsafe.h>
|
|
|
|
// SAL
|
|
#include <sal.h>
|
|
|
|
#pragma warning(pop)
|
|
|
|
// clang-format on
|