Fossil SCM

proper env() handler for (at least) NetBSD

bch 2019-08-02 05:09 trunk
Commit 2d4c16df5a9e61c25fd4b96831c5a1e9f8689ce0f61992d7185dddee11bed973
1 file changed +5
+5
--- src/file.c
+++ src/file.c
@@ -24,10 +24,11 @@
2424
#include <stdio.h>
2525
#include <string.h>
2626
#include <errno.h>
2727
#include <time.h>
2828
#include "file.h"
29
+extern char **environ;
2930
3031
/*
3132
** On Windows, include the Platform SDK header file.
3233
*/
3334
#ifdef _WIN32
@@ -1767,11 +1768,15 @@
17671768
}else{
17681769
rc = 1;
17691770
}
17701771
return rc;
17711772
#else
1773
+#ifdef HAVE_CLEARENV
17721774
return clearenv();
1775
+#else
1776
+ environ = NULL;
1777
+#endif
17731778
#endif
17741779
}
17751780
17761781
/*
17771782
** Like fopen() but always takes a UTF8 argument.
17781783
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button