path: root/compat/unsetenv.c
AgeCommit message (Collapse)Author
2013-07-21Revert "compat/unsetenv.c: Fix a sparse warning"Benoit Sigoure
This reverts commit ec535cc27e6c4f5e0b1d157e04f5511f166ecd9d. POSIX explicitly states "the [environ] variable, which must be declared by the user if it is to be used directly". Not declaring it causes compilation to fail on OS X. Instead don't declare the variable on MinGW, as it causes a spurious warning there. Signed-off-by: Benoit Sigoure <> Signed-off-by: Junio C Hamano <>
2013-04-28compat/unsetenv.c: Fix a sparse warningRamsay Jones
The gitunsetenv function includes an (redundant) declaration of the 'environ' symbol, which is a pointer to the table of environment variables. Unfortunately, on MinGW, this provokes sparse to issue the following warning: compat/unsetenv.c:5:20: warning: non-ANSI function declaration of \ function '__p__environ' On MinGW, the <stdlib.h> header defines the 'environ' symbol as a preprocessor macro (via _environ) which obtains the environ table pointer via a call to the __p__environ() function. In order to suppress the warning, we simply remove the redundant declaration of the 'environ' symbol, since the symbol is already declared correctly in <stdlib.h> (included via git-compat-util.h). Signed-off-by: Ramsay Jones <> Signed-off-by: Junio C Hamano <>
2006-12-20simplify inclusion of system header files.Junio C Hamano
This is a mechanical clean-up of the way *.c files include system header files. (1) sources under compat/, platform sha-1 implementations, and xdelta code are exempt from the following rules; (2) the first #include must be "git-compat-util.h" or one of our own header file that includes it first (e.g. config.h, builtin.h, pkt-line.h); (3) system headers that are included in "git-compat-util.h" need not be included in individual C source files. (4) "git-compat-util.h" does not have to include subsystem specific header files (e.g. expat.h). Signed-off-by: Junio C Hamano <>
2006-01-25Add compat/unsetenv.c .Jason Riedy
Implement a (slow) unsetenv() for older systems. Signed-off-by: Jason Riedy <> Signed-off-by: Junio C Hamano <>