From cac50608d64cc00278cdf5aad537e8d2f8bd02df Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 21 May 2019 01:35:01 -0500 Subject: [PATCH] Fix atom::PATH_END so it's greater than PATH_START. (#18339) Previously the enum list ended with entries copied values from base::PATH_ entries, so the subsequent entry (PATH_END) had a value in (base::PATH_START..base::PATH_END]. This only a correctness patch. atom::PATH_END doesn't appear to be used anywhere and it was the only atom::PATH_ enum bitten by this. --- atom/browser/atom_paths.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/atom/browser/atom_paths.h b/atom/browser/atom_paths.h index c51af1447..01e03056a 100644 --- a/atom/browser/atom_paths.h +++ b/atom/browser/atom_paths.h @@ -28,19 +28,23 @@ enum { #if defined(OS_LINUX) DIR_APP_DATA, // Application Data directory under the user profile. -#else +#endif + + PATH_END, // End of new paths. Those that follow redirect to base::DIR_* + +#if !defined(OS_LINUX) DIR_APP_DATA = base::DIR_APP_DATA, #endif #if defined(OS_POSIX) - DIR_CACHE = base::DIR_CACHE, // Directory where to put cache data. + DIR_CACHE = base::DIR_CACHE // Directory where to put cache data. #else - DIR_CACHE = base::DIR_APP_DATA, + DIR_CACHE = base::DIR_APP_DATA #endif - - PATH_END }; +static_assert(PATH_START < PATH_END, "invalid PATH boundaries"); + } // namespace atom #endif // ATOM_BROWSER_ATOM_PATHS_H_