Discussion:
[libdvdcss-devel] [PATCH] win32: Do not try to create cache directory in %USERPROFILE%
Diego Biurrun
2014-11-03 12:36:31 UTC
Permalink
Applications should rather store app-specific data in %APPDATA%.
Furthermore %USERPROFILE% is only referenced in a code branch
that would apply to obsolete Windows versions.
---
src/libdvdcss.c | 4 ----
1 file changed, 4 deletions(-)

diff --git a/src/libdvdcss.c b/src/libdvdcss.c
index 5e2230d..107301f 100644
--- a/src/libdvdcss.c
+++ b/src/libdvdcss.c
@@ -261,10 +261,6 @@ LIBDVDCSS_EXPORT dvdcss_t dvdcss_open ( const char *psz_target )
{
psz_home = getenv( "HOME" );
}
- if( psz_home == NULL )
- {
- psz_home = getenv( "USERPROFILE" );
- }

/* Cache our keys in ${HOME}/.dvdcss/ */
if( psz_home )
--
1.9.1
Jean-Baptiste Kempf
2014-11-03 13:05:51 UTC
Permalink
Post by Diego Biurrun
Applications should rather store app-specific data in %APPDATA%.
Furthermore %USERPROFILE% is only referenced in a code branch
that would apply to obsolete Windows versions.
Many enterprise setup still depend on that behaviour.

With my kindest regards,
--
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device
Diego Biurrun
2014-11-03 13:11:51 UTC
Permalink
Post by Jean-Baptiste Kempf
Post by Diego Biurrun
Applications should rather store app-specific data in %APPDATA%.
Furthermore %USERPROFILE% is only referenced in a code branch
that would apply to obsolete Windows versions.
Many enterprise setup still depend on that behaviour.
What setups are those?

Note that the code goes like this:

#if defined(_WIN32_IE) && _WIN32_IE >= 0x500
...
#else
...
if( psz_home == NULL )
psz_home = getenv( "USERPROFILE" );
...
#endif

So the code is only executed in the non-Windows part of the function since
_WIN32_IE is set to that value for all Windows toolchains by configure.

Diego
Jean-Baptiste Kempf
2014-11-03 13:14:03 UTC
Permalink
Post by Diego Biurrun
Post by Jean-Baptiste Kempf
Post by Diego Biurrun
Applications should rather store app-specific data in %APPDATA%.
Furthermore %USERPROFILE% is only referenced in a code branch
that would apply to obsolete Windows versions.
Many enterprise setup still depend on that behaviour.
What setups are those?
#if defined(_WIN32_IE) && _WIN32_IE >= 0x500
...
#else
...
if( psz_home == NULL )
psz_home = getenv( "USERPROFILE" );
...
#endif
So the code is only executed in the non-Windows part of the function since
_WIN32_IE is set to that value for all Windows toolchains by configure.
OK, then drop it.

With my kindest regards,
--
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device
Diego Biurrun
2014-11-04 09:59:09 UTC
Permalink
libdvdcss | branch: master | Diego Biurrun <***@biurrun.de> | Mon Nov 3 12:00:35 2014 +0100| [e9be7c5685e562fbdc286936a4b4876c03e2afa7] | committer: Diego Biurrun

win32: Do not try to create cache directory in %USERPROFILE%

Applications should rather store app-specific data in %APPDATA%.
Furthermore %USERPROFILE% is only referenced in a code branch
that would apply to unsupported Windows versions.
http://git.videolan.org/gitweb.cgi/libdvdcss.git/?a=commit;h=e9be7c5685e562fbdc286936a4b4876c03e2afa7
---

src/libdvdcss.c | 4 ----
1 file changed, 4 deletions(-)

diff --git a/src/libdvdcss.c b/src/libdvdcss.c
index 5e2230d..107301f 100644
--- a/src/libdvdcss.c
+++ b/src/libdvdcss.c
@@ -261,10 +261,6 @@ LIBDVDCSS_EXPORT dvdcss_t dvdcss_open ( const char *psz_target )
{
psz_home = getenv( "HOME" );
}
- if( psz_home == NULL )
- {
- psz_home = getenv( "USERPROFILE" );
- }

/* Cache our keys in ${HOME}/.dvdcss/ */
if( psz_home )

Loading...