2.7.1 Variable Expansion

char *zix_expand_environment_strings(ZixAllocator *allocator, const char *string)

Expand shell-style variables in a string.

On Windows, this expands environment variable references like “%USERPROFILE%”. On POSIX systems, it expands environment variable references like “$HOME”, and the special path component “~”.

Parameters:
  • allocator – Allocator used for returned string.

  • string – Input string to expand.

Returns:

A newly allocated copy of string with variables expanded, or null.