[PATCH] fall back on USERPROFILE variable if HOME is unset

Diego Biurrun diego at biurrun.de
Tue Sep 12 18:58:02 CEST 2006


Hi,

this is a small patch we have lying around in the MPlayer tree.  It came
with the following commit log message and should be safe to apply:

  fallback to USERPROFILE environment variable for caching CSS keys
  when HOME is not set (for MinGW builds running outside of MinGW).

Diego
-------------- next part --------------
Index: src/libdvdcss.c
===================================================================
--- src/libdvdcss.c	(revision 196)
+++ src/libdvdcss.c	(working copy)
@@ -298,6 +298,10 @@
         {
             psz_home = getenv( "HOME" );
         }
+        if( psz_home == NULL )
+        {
+            psz_home = getenv( "USERPROFILE" );
+        }
 
         /* Cache our keys in ${HOME}/.dvdcss/ */
         if( psz_home )


More information about the libdvdcss-devel mailing list