Cleanup patch from Larry
authorEric Andersen <andersen@codepoet.org>
Fri, 9 Mar 2001 00:42:46 +0000 (00:42 -0000)
committerEric Andersen <andersen@codepoet.org>
Fri, 9 Mar 2001 00:42:46 +0000 (00:42 -0000)
lash.c
sh.c
shell/lash.c

diff --git a/lash.c b/lash.c
index 8b7981b4d1808e224699306a1e842beef5e9bc2c..6a692d7453b8f67129f45bfc19fb6908dc1fad0f 100644 (file)
--- a/lash.c
+++ b/lash.c
@@ -61,6 +61,9 @@
 #include <unistd.h>
 #include <getopt.h>
 
+#undef __GLIBC__
+#undef __UCLIBC__
+
 #if ( (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 1) ) || defined (__UCLIBC__) 
 #include <wordexp.h>
 #define expand_t       wordexp_t
@@ -983,7 +986,7 @@ static int expand_arguments(char *command)
                                error_msg("out of space during expansion");
                                return FALSE;
                        }
-                       if (retval == GLOB_ABORTED || retval == GLOB_NOSYS) {
+                       if (retval != 0 && retval != GLOB_NOMATCH) {
                                /* Some other error.  */
                                error_msg("syntax error");
                                return FALSE;
@@ -1722,9 +1725,9 @@ static int busy_loop(FILE * input)
 
 #ifdef BB_FEATURE_SH_ENVIRONMENT
                                last_return_code=WEXITSTATUS(status);
-#endif
                                debug_printf("'%s' exited -- return code %d\n",
                                                job_list.fg->text, last_return_code);
+#endif
                                if (!job_list.fg->running_progs) {
                                        /* child exited */
                                        remove_job(&job_list, job_list.fg);
diff --git a/sh.c b/sh.c
index 8b7981b4d1808e224699306a1e842beef5e9bc2c..6a692d7453b8f67129f45bfc19fb6908dc1fad0f 100644 (file)
--- a/sh.c
+++ b/sh.c
@@ -61,6 +61,9 @@
 #include <unistd.h>
 #include <getopt.h>
 
+#undef __GLIBC__
+#undef __UCLIBC__
+
 #if ( (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 1) ) || defined (__UCLIBC__) 
 #include <wordexp.h>
 #define expand_t       wordexp_t
@@ -983,7 +986,7 @@ static int expand_arguments(char *command)
                                error_msg("out of space during expansion");
                                return FALSE;
                        }
-                       if (retval == GLOB_ABORTED || retval == GLOB_NOSYS) {
+                       if (retval != 0 && retval != GLOB_NOMATCH) {
                                /* Some other error.  */
                                error_msg("syntax error");
                                return FALSE;
@@ -1722,9 +1725,9 @@ static int busy_loop(FILE * input)
 
 #ifdef BB_FEATURE_SH_ENVIRONMENT
                                last_return_code=WEXITSTATUS(status);
-#endif
                                debug_printf("'%s' exited -- return code %d\n",
                                                job_list.fg->text, last_return_code);
+#endif
                                if (!job_list.fg->running_progs) {
                                        /* child exited */
                                        remove_job(&job_list, job_list.fg);
index 8b7981b4d1808e224699306a1e842beef5e9bc2c..6a692d7453b8f67129f45bfc19fb6908dc1fad0f 100644 (file)
@@ -61,6 +61,9 @@
 #include <unistd.h>
 #include <getopt.h>
 
+#undef __GLIBC__
+#undef __UCLIBC__
+
 #if ( (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 1) ) || defined (__UCLIBC__) 
 #include <wordexp.h>
 #define expand_t       wordexp_t
@@ -983,7 +986,7 @@ static int expand_arguments(char *command)
                                error_msg("out of space during expansion");
                                return FALSE;
                        }
-                       if (retval == GLOB_ABORTED || retval == GLOB_NOSYS) {
+                       if (retval != 0 && retval != GLOB_NOMATCH) {
                                /* Some other error.  */
                                error_msg("syntax error");
                                return FALSE;
@@ -1722,9 +1725,9 @@ static int busy_loop(FILE * input)
 
 #ifdef BB_FEATURE_SH_ENVIRONMENT
                                last_return_code=WEXITSTATUS(status);
-#endif
                                debug_printf("'%s' exited -- return code %d\n",
                                                job_list.fg->text, last_return_code);
+#endif
                                if (!job_list.fg->running_progs) {
                                        /* child exited */
                                        remove_job(&job_list, job_list.fg);