bd69998516
Previously, wordexp() was used. However for providing Windows builds of mconf-idf we can't use wordexp() so we use this simplified environment variable expansion code instead. The reasoning here is to make the behaviour consistent across Windows (CMake vs GNU Make), Linux & macOS mconf.
13 lines
410 B
C
13 lines
410 B
C
#pragma once
|
|
|
|
/* Expand any $ENV type environment variables in 'input',
|
|
return a newly allocated buffer with the result.
|
|
|
|
Buffer should be freed after use.
|
|
|
|
This is very basic expansion, doesn't do escaping or anything else.
|
|
*/
|
|
char *expand_environment(const char *input, const char *src_name, int src_line_no);
|
|
|
|
/* Free a buffer allocated by expand_environment */
|
|
void free_expanded(char *expanded);
|