#18 Patch for logfilename on *nix systems

Unstable (example)
Simon Egli

On *nix systems the logfilename often contains the ~ character
in place of the home directory path, if not specified with the -l option.
fopen can't handle this and throws errors while writting to logfiles in the
home directory.
I changed the mechanism so that ~ (as the first character of logdir)
will get overwritten by the correct path.
I also thought about altering the logdir name before it get's into this
logOpen function,
but I concluded that the logfunction should handle this "exception" because:
1. It's only a problem on linux systems
2. one shouldn't be concerned about the logdirname/HOME-environment-variable
and assume that functions handling the logdirname work correctly
with the ~ character.

Btw: The patch assumes that if we're not on a WIN32 system, we're on some *nix system using the ~ for the homedirectory,
this may or may not lead to problems if that's not true (didn't find anything on the web for asking the precompiler if we're on a *nix system).
However, it's still safe, if you/other systems don't use the ~ character at the start of the logdirname!


  • Anonymous - 2010-05-16

    Thanks for the bug report w/patch! I'll integrate it when I have a bit of time, and it'll be in the next release.

  • Anonymous - 2010-06-02

    Checked in changes to head. Will be in next release. One small change: also handles ~foo (i.e. home directory of user foo).

  • Anonymous - 2010-06-02
    • status: open --> closed-fixed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks