projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e725bfe
)
awk: guard against empty environment
author
Denis Vlasenko
<vda.linux@googlemail.com>
Thu, 3 May 2007 22:57:56 +0000
(22:57 -0000)
committer
Denis Vlasenko
<vda.linux@googlemail.com>
Thu, 3 May 2007 22:57:56 +0000
(22:57 -0000)
editors/awk.c
patch
|
blob
|
history
diff --git
a/editors/awk.c
b/editors/awk.c
index 5a504d03456179218ee35066c989a7c869ccc77e..bc9e99a6f555982e30bd08bfe43f017355c9a1fc 100644
(file)
--- a/
editors/awk.c
+++ b/
editors/awk.c
@@
-2696,7
+2696,8
@@
int awk_main(int argc, char **argv)
newfile("/dev/stdout")->F = stdout;
newfile("/dev/stderr")->F = stderr;
- for (envp = environ; *envp; envp++) {
+ /* Huh, people report that sometimes environ is NULL. Oh well. */
+ if (environ) for (envp = environ; *envp; envp++) {
char *s = xstrdup(*envp);
char *s1 = strchr(s, '=');
if (s1) {