Merge remote-tracking branch 'github/master'
authorRudolf Polzer <divverent@alientrap.org>
Tue, 27 Mar 2012 10:11:37 +0000 (12:11 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Tue, 27 Mar 2012 10:11:37 +0000 (12:11 +0200)
Conflicts:
.gitignore
config.py
libs/synapse/synapse.cpp
plugins/imagehl/lbmlib.cpp
plugins/surface_heretic2/surfacedialog.cpp
plugins/surface_ufoai/surfacedialog.cpp
radiant/brushscript.cpp
radiant/main.cpp
radiant/preferences.cpp
tools/quake3/common/cmdlib.c
tools/quake3/common/cmdlib.h
tools/quake3/q3map2/path_init.c
windows_compile_guide/index.html

1  2 
contrib/bobtoolz/DBrush.cpp
libs/splines/splines.cpp
libs/splines/util_str.cpp
tools/quake3/common/cmdlib.c
tools/quake3/common/cmdlib.h
tools/quake3/common/inout.c
tools/quake3/q3map2/main.c
tools/quake3/q3map2/path_init.c
tools/quake3/q3map2/q3map2.h

@@@ -703,12 -689,12 +703,12 @@@ void DBrush::SaveToFile( FILE *pFile )
                                 ( *pp )->points[0][0], ( *pp )->points[0][1], ( *pp )->points[0][2],
                                 ( *pp )->points[1][0], ( *pp )->points[1][1], ( *pp )->points[1][2],
                                 ( *pp )->points[2][0], ( *pp )->points[2][1], ( *pp )->points[2][2],
 -                               ( *pp )->texInfo.m_TextureName,
 -                               ( *pp )->texInfo.m_fShift[0], ( *pp )->texInfo.m_fShift[1],
 -                               ( *pp )->texInfo.m_fScale[0], ( *pp )->texInfo.m_fScale[0],
 -                               ( *pp )->texInfo.m_fRotate );
 +                               ( *pp )->m_shader.c_str(),
 +                               ( *pp )->texInfo.m_texdef.shift[0], ( *pp )->texInfo.m_texdef.shift[1],
 +                               ( *pp )->texInfo.m_texdef.scale[0], ( *pp )->texInfo.m_texdef.scale[0],
 +                               ( *pp )->texInfo.m_texdef.rotate );
  
-               fprintf( pFile, buffer );
+               fprintf( pFile, "%s", buffer );
        }
  
        fprintf( pFile, "}\n" );
Simple merge
Simple merge
@@@ -244,7 -244,10 +244,10 @@@ char *ExpandArg( const char *path )
  
  char *ExpandPath( const char *path ){
        static char full[1024];
-       if ( !*qdir || path[0] == '/' || path[0] == '\\' || path[1] == ':' ) {
 -      if ( !qdir[0] ) {
++      if ( !qdir ) {
+               Error( "ExpandPath called without qdir set" );
+       }
+       if ( path[0] == '/' || path[0] == '\\' || path[1] == ':' ) {
                strcpy( full, path );
                return full;
        }
  
  char *ExpandGamePath( const char *path ){
        static char full[1024];
-       if ( !*gamedir ) {
 -      if ( !qdir[0] ) {
 -              Error( "ExpandGamePath called without qdir set" );
++      if ( !gamedir[0] ) {
 +              Error( "ExpandGamePath called without gamedir set" );
        }
        if ( path[0] == '/' || path[0] == '\\' || path[1] == ':' ) {
                strcpy( full, path );
  #endif
  
  
- #define MAX_OS_PATH     1024
 +#ifdef PATH_MAX
 +#define MAX_OS_PATH     PATH_MAX
 +#else
+ #define MAX_OS_PATH     4096
 +#endif
  #define MEM_BLOCKSIZE 4096
  
  // the dec offsetof macro doesnt work very well...
Simple merge
Simple merge
@@@ -66,32 -66,23 +66,27 @@@ char *LokiGetHomeDir( void )
        #ifndef Q_UNIX
        return NULL;
        #else
+       static char     buf[ 4096 ];
+       struct passwd   pw, *pwp;
        char            *home;
-       uid_t id;
-       struct passwd   *pwd;
 +      static char homeBuf[MAX_OS_PATH];
  
  
        /* get the home environment variable */
        home = getenv( "HOME" );
-       if ( home == NULL ) {
-               /* do some more digging */
-               id = getuid();
-               setpwent();
-               while ( ( pwd = getpwent() ) != NULL )
-               {
-                       if ( pwd->pw_uid == id ) {
-                               home = pwd->pw_dir;
-                               break;
-                       }
 -      if ( home ) {
 -              return Q_strncpyz( buf, home, sizeof( buf ) );
 -      }
+       /* look up home dir in password database */
 -      if ( getpwuid_r( getuid(), &pw, buf, sizeof( buf ), &pwp ) == 0 ) {
 -              return pw.pw_dir;
++      if(!home)
++      {
++              if ( getpwuid_r( getuid(), &pw, buf, sizeof( buf ), &pwp ) == 0 ) {
++                      return pw.pw_dir;
 +              }
-               endpwent();
        }
  
 -      return NULL;
 +      snprintf( homeBuf, sizeof( homeBuf ), "%s/.", home );
 +
 +      /* return it */
 +      return homeBuf;
        #endif
  }
  
@@@ -130,21 -105,22 +125,16 @@@ void LokiInitPaths( char *argv0 )
        qboolean found;
  
  
 -      /* get home dir */
 -      home = LokiGetHomeDir();
 -      if ( home == NULL ) {
 -              home = ".";
 -      }
 -
+       path = getenv( "PATH" );
        /* do some path divining */
-       strcpy( temp, argv0 );
-       if ( strrchr( argv0, '/' ) ) {
+       Q_strncpyz( temp, argv0, sizeof( temp ) );
+       if ( strrchr( temp, '/' ) ) {
                argv0 = strrchr( argv0, '/' ) + 1;
        }
-       else
-       {
-               /* get path environment variable */
-               path = getenv( "PATH" );
-               /* minor setup */
-               last = last0;
-               last[ 0 ] = path[ 0 ];
-               last[ 1 ] = '\0';
+       else if ( path ) {
                found = qfalse;
+               last = path;
  
                /* go through each : segment of path */
                while ( last[ 0 ] != '\0' && found == qfalse )
  #include "inout.h"
  #include "vfs.h"
  #include "png.h"
 -
 +#include "md4.h"
  #include <stdlib.h>
  
+ #define MIN(a, b) ((a) < (b) ? (a) : (b))
+ #define MAX(a, b) ((a) > (b) ? (a) : (b))
  
  
  /* -------------------------------------------------------------------------------