mirror of
https://github.com/git/git
synced 2024-08-25 10:45:59 +00:00
![Patrick Steinhardt](/assets/img/avatar_default.png)
The `getenv_safe()` helper function helps to safely retrieve multiple environment values without the need to depend on platform-specific behaviour for the return value's lifetime. We'll make use of this function in a following patch, so let's make it available by making it non-static and adding a declaration. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 lines
246 B
C
13 lines
246 B
C
#ifndef ENVIRONMENT_H
|
|
#define ENVIRONMENT_H
|
|
|
|
#include "strvec.h"
|
|
|
|
/*
|
|
* Wrapper of getenv() that returns a strdup value. This value is kept
|
|
* in argv to be freed later.
|
|
*/
|
|
const char *getenv_safe(struct strvec *argv, const char *name);
|
|
|
|
#endif
|