forgot about avn add... :(
[oweals/busybox.git] / shell / lash.c
index fd6bea17721142c28e731728ad19fc1e4447ca63..4067bc6bc853f2bb6622a4658477286bc3101df3 100644 (file)
@@ -426,7 +426,7 @@ static int builtin_source(struct child_prog *child)
        FILE *input;
        int status;
 
-       input = bb_wfopen(child->argv[1], "r");
+       input = fopen_or_warn(child->argv[1], "r");
        if (!input) {
                return EXIT_FAILURE;
        }
@@ -678,7 +678,7 @@ static int get_command(FILE * source, char *command)
 
        if (!fgets(command, BUFSIZ - 2, source)) {
                if (source == stdin)
-                       printf("\n");
+                       puts("");
                return 1;
        }
 
@@ -1145,7 +1145,7 @@ static int pseudo_exec(struct child_prog *child)
        /* Check if the command matches any of the forking builtins. */
        for (x = bltins_forking; x->cmd; x++) {
                if (strcmp(child->argv[0], x->cmd) == 0) {
-                       bb_applet_name=x->cmd;
+                       applet_name=x->cmd;
                        _exit (x->function(child));
                }
        }
@@ -1503,7 +1503,7 @@ static inline void setup_job_control(void)
 
 int lash_main(int argc_l, char **argv_l)
 {
-       unsigned long opt;
+       unsigned opt;
        FILE *input = stdin;
        argc = argc_l;
        argv = argv_l;
@@ -1522,12 +1522,12 @@ int lash_main(int argc_l, char **argv_l)
                        llist_add_to(&close_me_list, (void *)(long)fileno(prof_input));
                        /* Now run the file */
                        busy_loop(prof_input);
-                       bb_fclose_nonstdin(prof_input);
+                       fclose_if_not_stdin(prof_input);
                        llist_pop(&close_me_list);
                }
        }
 
-       opt = bb_getopt_ulflags(argc_l, argv_l, "+ic:", &local_pending_command);
+       opt = getopt32(argc_l, argv_l, "+ic:", &local_pending_command);
 #define LASH_OPT_i (1<<0)
 #define LASH_OPT_c (1<<2)
        if (opt & LASH_OPT_c) {