Diffstat (limited to 'noncore/settings/networksettings2/networksettings2/system.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/networksettings2/system.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/noncore/settings/networksettings2/networksettings2/system.cpp b/noncore/settings/networksettings2/networksettings2/system.cpp index a579396..271e73d 100644 --- a/noncore/settings/networksettings2/networksettings2/system.cpp +++ b/noncore/settings/networksettings2/networksettings2/system.cpp @@ -391,6 +391,9 @@ void VLog( char * Format, ... ) { if( logf == (FILE *)0 ) { - // logf = fopen( "/tmp/ns2log", "a" ); + if( getenv("NS2STDERR") ) { logf = stderr; + } else { + logf = fopen( "/tmp/ns2log", "a" ); + } if( ! logf ) { fprintf( stderr, "Cannot open logfile /tmp/ns2log %d\n", @@ -412,6 +415,15 @@ void LogClose( void ) { if( (long)logf > 1 ) { fprintf( logf, "____ CLOSE LOGFILE ____\n"); + if( logf != stderr ) { fclose( logf ); + } logf = 0; } } + +QString removeSpaces( const QString & X ) { + QStringList SL; + + SL = QStringList::split( " ", X ); + return SL.join( "_" ); +} |