changeset 371:587353009f65 src

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)
author nicodvb
date Thu, 05 Jun 2008 08:55:12 +0000
parents d80a041928be
children 7cf80b1cba5a
files remap.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/remap.c	Thu Jun 05 08:45:35 2008 +0000
+++ b/remap.c	Thu Jun 05 08:55:12 2008 +0000
@@ -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 *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 */