changeset 27838:659acfaaf0c9

Use APPDATA for startup file location on Windows (bug #40444). * oct-env.cc (do_get_user_config_directory): Get location of APPDATA instead of LOCALAPPDATA folder. * basic.txi, NEWS: Change documentation and announcement accordingly.
author Markus Mützel <markus.muetzel@gmx.de>
date Sun, 15 Dec 2019 12:35:12 +0100
parents 6bbff502f89d
children a8c5255c34b1
files NEWS doc/interpreter/basics.txi liboctave/system/oct-env.cc
diffstat 3 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Sun Dec 15 10:38:14 2019 +0100
+++ b/NEWS	Sun Dec 15 12:35:12 2019 +0100
@@ -57,7 +57,7 @@
 - The startup file `octaverc` now can be located in the platform
   dependent location for user local configuration files (e.g.
   ${XDG_CONFIG_HOME}/octave/octaverc on Unix-like operating systems or
-  %LOCALAPPDATA%\octave\octaverc on Windows).
+  %APPDATA%\octave\octaverc on Windows).
 
 #### Graphics backend
 
--- a/doc/interpreter/basics.txi	Sun Dec 15 10:38:14 2019 +0100
+++ b/doc/interpreter/basics.txi	Sun Dec 15 12:35:12 2019 +0100
@@ -362,7 +362,7 @@
 @cindex personal startup file
 where @code{@var{config-dir}} is the platform-dependent location for user
 local configuration files (e.g. @w{@env{$XDG_CONFIG_HOME}} on many Unix-like
-operating systems or @w{@env{%LOCALAPPDATA%}} on Windows).
+operating systems or @w{@env{%APPDATA%}} on Windows).
 
 @item ~/.octaverc
 @cindex personal startup file
--- a/liboctave/system/oct-env.cc	Sun Dec 15 10:38:14 2019 +0100
+++ b/liboctave/system/oct-env.cc	Sun Dec 15 12:35:12 2019 +0100
@@ -242,8 +242,7 @@
 
 #if defined (OCTAVE_HAVE_WINDOWS_FILESYSTEM) && defined (OCTAVE_USE_WINDOWS_API)
       wchar_t path[MAX_PATH+1];
-      if (SHGetFolderPathW (nullptr,
-                            CSIDL_LOCAL_APPDATA | CSIDL_FLAG_DONT_VERIFY,
+      if (SHGetFolderPathW (nullptr, CSIDL_APPDATA | CSIDL_FLAG_DONT_VERIFY,
                             nullptr, SHGFP_TYPE_CURRENT, path) == S_OK)
         {
           char *local_app_data = u8_from_wchar (path);