#92 Allow environment variables in config options

v0.9.18
open
7
2012-10-03
2007-10-25
William Kendrick
No

Support %VARIABLE% on Windows, ${VARIABLE} on Linux, etc., as part of values in the config file.

Discussion

  • Logged In: YES
    user_id=132410
    Originator: YES

    Also support "~" for $HOME. (Per bug #1903369)

     
  • Logged In: YES
    user_id=132410
    Originator: YES

    Per Francis Giraldeau, glibc includes a function to expand this, "wordexp", which we can use (at least on Linux, and probably on OS X; he is checking on Windows). Example use:

    include <stdio.h>

    include <wordexp.h>

    int main(int argc, char argv[])
    {
    char
    savedir = argv[1];
    wordexp_t result;
    wordexp(savedir, &result, 0);
    printf("%s\n",result.we_wordv[0]);
    return 0;
    }

     
  • Is the patch provided for Linux is acceptable for the project? I didn't see the patch commited into the trunk yet. The current code fix only for '~', and other environment variables are not substituted.

    It may not fix the problem for other platform, but it fix it for linux at least.

    Thanks,

    Francis

     
  • The feature request persist, but I confirm that the current version fixes the problem for "~" expansion.

     
  • Still need to support this on Windows and other platforms...