fix printf warning
[oweals/busybox.git] / shell / hush.c
index 5da975746789a23a3e308677bd13f9b950adff78..49e2397ad2a7456e0e0a514366b2bd8af846d29c 100644 (file)
@@ -1124,18 +1124,6 @@ static void pseudo_exec(struct child_prog *child)
                        char** argv_l=child->argv;
                        char *name = child->argv[0];
 
-#ifdef CONFIG_FEATURE_SH_APPLETS_ALWAYS_WIN
-                       /* Following discussions from November 2000 on the busybox mailing
-                        * list, the default configuration, (without
-                        * bb_get_last_path_component()) lets the user force use of an
-                        * external command by specifying the full (with slashes) filename.
-                        * If you enable CONFIG_FEATURE_SH_APPLETS_ALWAYS_WIN, then applets
-                        * _aways_ override external commands, so if you want to run
-                        * /bin/cat, it will use BusyBox cat even if /bin/cat exists on the
-                        * filesystem and is _not_ busybox.  Some systems may want this,
-                        * most do not.  */
-                       name = bb_get_last_path_component(name);
-#endif
                        /* Count argc for use in a second... */
                        for(argc_l=0;*argv_l!=NULL; argv_l++, argc_l++);
                        optind = 1;
@@ -1451,7 +1439,7 @@ static int run_pipe_real(struct pipe *pi)
                }
 
                /* XXX test for failed fork()? */
-#if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__)
+#if !defined(__UCLIBC__) || defined(__ARCH_HAS_MMU__)
                if (!(child->pid = fork()))
 #else
                if (!(child->pid = vfork()))
@@ -1569,7 +1557,7 @@ static int run_list_real(struct pipe *pi)
                if (rmode == RES_THEN || rmode == RES_ELSE) if_code = next_if_code;
                if (rmode == RES_THEN &&  if_code) continue;
                if (rmode == RES_ELSE && !if_code) continue;
-               if (rmode == RES_ELIF && !if_code) continue;
+               if (rmode == RES_ELIF && !if_code) break;
                if (rmode == RES_FOR && pi->num_progs) {
                        if (!list) {
                                /* if no variable values after "in" we skip "for" */
@@ -2270,7 +2258,7 @@ FILE *generate_stream_from_list(struct pipe *head)
 #if 1
        int pid, channel[2];
        if (pipe(channel)<0) bb_perror_msg_and_die("pipe");
-#if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__)
+#if !defined(__UCLIBC__) || defined(__ARCH_HAS_MMU__)
        pid=fork();
 #else
        pid=vfork();
@@ -2658,7 +2646,7 @@ void update_ifs_map(void)
        mapset(ifs, 2);            /* also flow through if quoted */
 }
 
-/* most recursion does not come through here, the exeception is
+/* most recursion does not come through here, the exception is
  * from builtin_source() */
 int parse_stream_outer(struct in_str *inp, int flag)
 {
@@ -2825,7 +2813,7 @@ int hush_main(int argc, char **argv)
         *    standard output is a terminal
         *    Refer to Posix.2, the description of the `sh' utility. */
        if (argv[optind]==NULL && input==stdin &&
-                       isatty(fileno(stdin)) && isatty(fileno(stdout))) {
+                       isatty(STDIN_FILENO) && isatty(STDOUT_FILENO)) {
                interactive++;
        }