mirror of
https://github.com/boostorg/build.git
synced 2026-02-14 00:32:11 +00:00
Boost Jam code cleanup - updated path_tmpdir() to return a string object instead of a raw C char pointer.
[SVN r79068]
This commit is contained in:
@@ -1182,11 +1182,11 @@ static FILE * open_command_file( int const slot )
|
||||
if ( !command_file->value )
|
||||
{
|
||||
DWORD const procID = GetCurrentProcessId();
|
||||
char const * const tmpdir = path_tmpdir();
|
||||
string const * const tmpdir = path_tmpdir();
|
||||
string_new( command_file );
|
||||
string_reserve( command_file, strlen( tmpdir ) + 64 );
|
||||
string_reserve( command_file, tmpdir->size + 64 );
|
||||
command_file->size = sprintf( command_file->value, "%s\\jam%d-%02d.bat",
|
||||
tmpdir, procID, slot );
|
||||
tmpdir->value, procID, slot );
|
||||
}
|
||||
|
||||
/* Write command to bat file. For some reason this open can fail
|
||||
|
||||
@@ -72,7 +72,7 @@ void path_add_key( OBJECT * path );
|
||||
/** Returns a static pointer to the system dependent path to the temporary
|
||||
directory. NOTE: *without* a trailing path separator.
|
||||
*/
|
||||
char const * path_tmpdir( void );
|
||||
string const * path_tmpdir( void );
|
||||
|
||||
/** Returns a new temporary name.
|
||||
*/
|
||||
|
||||
@@ -522,7 +522,7 @@ void path_done( void )
|
||||
|
||||
#endif
|
||||
|
||||
char const * path_tmpdir()
|
||||
string const * path_tmpdir()
|
||||
{
|
||||
static string buffer[ 1 ];
|
||||
static int have_result;
|
||||
@@ -546,7 +546,7 @@ char const * path_tmpdir()
|
||||
#endif
|
||||
have_result = 1;
|
||||
}
|
||||
return buffer->value;
|
||||
return buffer;
|
||||
}
|
||||
|
||||
OBJECT * path_tmpnam( void )
|
||||
@@ -571,7 +571,7 @@ OBJECT * path_tmpfile( void )
|
||||
OBJECT * tmpnam;
|
||||
|
||||
string file_path[ 1 ];
|
||||
string_copy( file_path, path_tmpdir() );
|
||||
string_copy( file_path, path_tmpdir()->value );
|
||||
string_push_back( file_path, PATH_DELIM );
|
||||
tmpnam = path_tmpnam();
|
||||
string_append( file_path, object_str( tmpnam ) );
|
||||
|
||||
@@ -176,7 +176,7 @@ LIST * var_get( struct module_t * module, OBJECT * symbol )
|
||||
if ( object_equal( symbol, constant_TMPDIR ) )
|
||||
{
|
||||
list_free( saved_var );
|
||||
result = saved_var = list_new( object_new( path_tmpdir() ) );
|
||||
result = saved_var = list_new( object_new( path_tmpdir()->value ) );
|
||||
}
|
||||
else if ( object_equal( symbol, constant_TMPNAME ) )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user