diff --git a/src/common/rclinit.cpp b/src/common/rclinit.cpp index 7215d304..bd44ba66 100644 --- a/src/common/rclinit.cpp +++ b/src/common/rclinit.cpp @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "@(#$Id: rclinit.cpp,v 1.7 2006-11-08 07:22:14 dockes Exp $ (C) 2004 J.F.Dockes"; +static char rcsid[] = "@(#$Id: rclinit.cpp,v 1.8 2006-11-08 15:34:20 dockes Exp $ (C) 2004 J.F.Dockes"; #endif /* * This program is free software; you can redistribute it and/or modify @@ -68,8 +68,9 @@ RclConfig *recollinit(RclInitFlags flags, // Initialize logging if (!logfilename.empty()) { logfilename = path_tildexpand(logfilename); - // If not an absolute path, compute relative to config dir - if (logfilename.at(0) != '/') { + // If not an absolute path or , compute relative to config dir + if (logfilename.at(0) != '/' && + !DebugLog::DebugLog::isspecialname(logfilename.c_str())) { logfilename = path_cat(config->getConfDir(), logfilename); } DebugLog::setfilename(logfilename.c_str()); diff --git a/src/utils/debuglog.cpp b/src/utils/debuglog.cpp index 39c35bfd..3fe79976 100755 --- a/src/utils/debuglog.cpp +++ b/src/utils/debuglog.cpp @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid [] = "@(#$Id: debuglog.cpp,v 1.3 2006-01-23 13:32:28 dockes Exp $ (C) 2002 OKYZ"; +static char rcsid [] = "@(#$Id: debuglog.cpp,v 1.4 2006-11-08 15:34:20 dockes Exp $ (C) 2002 OKYZ"; #endif /* * This program is free software; you can redistribute it and/or modify @@ -43,6 +43,11 @@ namespace DebugLog { #endif // NO_NAMESPACES +bool DebugLog::isspecialname(const char *logname) +{ + return !strcmp(logname, "stdout") || !strcmp(logname, "stderr"); +} + class DebugLogWriter { public: virtual ~DebugLogWriter() {} diff --git a/src/utils/debuglog.h b/src/utils/debuglog.h index 02cd7833..b63ceff3 100755 --- a/src/utils/debuglog.h +++ b/src/utils/debuglog.h @@ -61,6 +61,7 @@ class DebugLog { virtual void pushlevel(int lev); virtual void poplevel(); virtual void logdate(int onoff) {dodate = onoff;} + static bool isspecialname(const char *logname); }; extern DebugLog *getdbl();