Avoid segfault when export is invoked with no arguments. Thanks to
Gennady Feldman.
This commit is contained in:
parent
3f98040554
commit
2129f97cd9
1
lash.c
1
lash.c
@ -426,6 +426,7 @@ static int builtin_export(struct child_prog *child)
|
||||
for (e = environ; *e; e++) {
|
||||
printf( "%s\n", *e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
res = putenv(v);
|
||||
if (res)
|
||||
|
1
sh.c
1
sh.c
@ -426,6 +426,7 @@ static int builtin_export(struct child_prog *child)
|
||||
for (e = environ; *e; e++) {
|
||||
printf( "%s\n", *e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
res = putenv(v);
|
||||
if (res)
|
||||
|
@ -426,6 +426,7 @@ static int builtin_export(struct child_prog *child)
|
||||
for (e = environ; *e; e++) {
|
||||
printf( "%s\n", *e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
res = putenv(v);
|
||||
if (res)
|
||||
|
Loading…
Reference in New Issue
Block a user