esp-idf/tools/kconfig/expand_env.h
Angus Gratton bd69998516 mconf-idf: Use same 'simple expand' logic, same as kconfig-frontends
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.
2019-07-01 00:38:55 +00:00

14 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);