[DVDnav-discuss] r1064 - trunk/libdvdnav/src/remap.c

nicodvb subversion at mplayerhq.hu
Thu Jun 5 10:55:13 CEST 2008


Author: nicodvb
Date: Thu Jun  5 10:55:12 2008
New Revision: 1064

Log:
replace an assert(getenv("HOME)) with a return NULL in cases
when $HOME is not defined, as in the case of windows.
Patch by Rafael Carré (funman videolan org)



Modified:
   trunk/libdvdnav/src/remap.c

Modified: trunk/libdvdnav/src/remap.c
==============================================================================
--- trunk/libdvdnav/src/remap.c	(original)
+++ trunk/libdvdnav/src/remap.c	Thu Jun  5 10:55:12 2008
@@ -35,7 +35,6 @@
 #endif
 #endif /* _MSC_VER */
 
-#include <assert.h>
 #include <inttypes.h>
 #include <limits.h>
 #include <sys/time.h>
@@ -202,7 +201,11 @@ remap_t* remap_loadmap( char *title) {
     remap_t *map;
 
     /* Build the map filename */
-    home = getenv("HOME"); assert(home);
+    home = getenv("HOME");
+    if(!home) {
+        fprintf(MSG_OUT, "libdvdnav: Unable to find home directory" );
+        return NULL;
+    }
     snprintf(fname, sizeof(fname), "%s/.dvdnav/%s.map", home, title);
 
     /* Open the map file */



More information about the DVDnav-discuss mailing list