Fossil SCM
proper env() handler for (at least) NetBSD
Commit
2d4c16df5a9e61c25fd4b96831c5a1e9f8689ce0f61992d7185dddee11bed973
Parent
c31ff76fe98d4b4…
1 file changed
+5
+5
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -24,10 +24,11 @@ | ||
| 24 | 24 | #include <stdio.h> |
| 25 | 25 | #include <string.h> |
| 26 | 26 | #include <errno.h> |
| 27 | 27 | #include <time.h> |
| 28 | 28 | #include "file.h" |
| 29 | +extern char **environ; | |
| 29 | 30 | |
| 30 | 31 | /* |
| 31 | 32 | ** On Windows, include the Platform SDK header file. |
| 32 | 33 | */ |
| 33 | 34 | #ifdef _WIN32 |
| @@ -1767,11 +1768,15 @@ | ||
| 1767 | 1768 | }else{ |
| 1768 | 1769 | rc = 1; |
| 1769 | 1770 | } |
| 1770 | 1771 | return rc; |
| 1771 | 1772 | #else |
| 1773 | +#ifdef HAVE_CLEARENV | |
| 1772 | 1774 | return clearenv(); |
| 1775 | +#else | |
| 1776 | + environ = NULL; | |
| 1777 | +#endif | |
| 1773 | 1778 | #endif |
| 1774 | 1779 | } |
| 1775 | 1780 | |
| 1776 | 1781 | /* |
| 1777 | 1782 | ** Like fopen() but always takes a UTF8 argument. |
| 1778 | 1783 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -24,10 +24,11 @@ | |
| 24 | #include <stdio.h> |
| 25 | #include <string.h> |
| 26 | #include <errno.h> |
| 27 | #include <time.h> |
| 28 | #include "file.h" |
| 29 | |
| 30 | /* |
| 31 | ** On Windows, include the Platform SDK header file. |
| 32 | */ |
| 33 | #ifdef _WIN32 |
| @@ -1767,11 +1768,15 @@ | |
| 1767 | }else{ |
| 1768 | rc = 1; |
| 1769 | } |
| 1770 | return rc; |
| 1771 | #else |
| 1772 | return clearenv(); |
| 1773 | #endif |
| 1774 | } |
| 1775 | |
| 1776 | /* |
| 1777 | ** Like fopen() but always takes a UTF8 argument. |
| 1778 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -24,10 +24,11 @@ | |
| 24 | #include <stdio.h> |
| 25 | #include <string.h> |
| 26 | #include <errno.h> |
| 27 | #include <time.h> |
| 28 | #include "file.h" |
| 29 | extern char **environ; |
| 30 | |
| 31 | /* |
| 32 | ** On Windows, include the Platform SDK header file. |
| 33 | */ |
| 34 | #ifdef _WIN32 |
| @@ -1767,11 +1768,15 @@ | |
| 1768 | }else{ |
| 1769 | rc = 1; |
| 1770 | } |
| 1771 | return rc; |
| 1772 | #else |
| 1773 | #ifdef HAVE_CLEARENV |
| 1774 | return clearenv(); |
| 1775 | #else |
| 1776 | environ = NULL; |
| 1777 | #endif |
| 1778 | #endif |
| 1779 | } |
| 1780 | |
| 1781 | /* |
| 1782 | ** Like fopen() but always takes a UTF8 argument. |
| 1783 |