bugfix #2931 crash if $HOME not set

unchecked pointer returned from BLI_gethome().
This commit is contained in:
Stephen Swaney
2005-08-13 17:20:46 +00:00
parent 2fe1f9df2a
commit 9e6ad3dffc

View File

@@ -69,8 +69,15 @@ char *bpy_gethome(int append_scriptsdir)
else if (homedir[0] != '\0')
return homedir;
/* BLI_gethome() can return NULL if env vars are not set */
s = BLI_gethome();
if( !s ) /* bail if no $HOME */
{
printf("$HOME is NOT set\n");
return NULL;
}
if( strstr( s, ".blender" ) )
PyOS_snprintf( homedir, FILE_MAXDIR, s );
else