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++) {
|
for (e = environ; *e; e++) {
|
||||||
printf( "%s\n", *e);
|
printf( "%s\n", *e);
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
res = putenv(v);
|
res = putenv(v);
|
||||||
if (res)
|
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++) {
|
for (e = environ; *e; e++) {
|
||||||
printf( "%s\n", *e);
|
printf( "%s\n", *e);
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
res = putenv(v);
|
res = putenv(v);
|
||||||
if (res)
|
if (res)
|
||||||
|
@ -426,6 +426,7 @@ static int builtin_export(struct child_prog *child)
|
|||||||
for (e = environ; *e; e++) {
|
for (e = environ; *e; e++) {
|
||||||
printf( "%s\n", *e);
|
printf( "%s\n", *e);
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
res = putenv(v);
|
res = putenv(v);
|
||||||
if (res)
|
if (res)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user