Avoid segfault when export is invoked with no arguments. Thanks to
authorMatt Kraai <kraai@debian.org>
Wed, 4 Apr 2001 17:50:04 +0000 (17:50 -0000)
committerMatt Kraai <kraai@debian.org>
Wed, 4 Apr 2001 17:50:04 +0000 (17:50 -0000)
Gennady Feldman.

lash.c
sh.c
shell/lash.c

diff --git a/lash.c b/lash.c
index 28015cbb33451bc4f9aea661ab82bd1aac900658..89325b63d96d824d76c8061b675c9061a6985355 100644 (file)
--- a/lash.c
+++ b/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)
diff --git a/sh.c b/sh.c
index 28015cbb33451bc4f9aea661ab82bd1aac900658..89325b63d96d824d76c8061b675c9061a6985355 100644 (file)
--- a/sh.c
+++ b/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)
index 28015cbb33451bc4f9aea661ab82bd1aac900658..89325b63d96d824d76c8061b675c9061a6985355 100644 (file)
@@ -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)