aboutsummaryrefslogtreecommitdiff
path: root/shell/msh.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/msh.c')
-rw-r--r--shell/msh.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/shell/msh.c b/shell/msh.c
index 31dd04f3e..e7059507a 100644
--- a/shell/msh.c
+++ b/shell/msh.c
@@ -23,7 +23,7 @@
23 * You should have received a copy of the GNU General Public License 23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software 24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 * 26 *
27 * Original copyright notice is retained at the end of this file. 27 * Original copyright notice is retained at the end of this file.
28 */ 28 */
29 29
@@ -770,7 +770,7 @@ extern int msh_main(int argc, char **argv)
770 if (--argc > 0) 770 if (--argc > 0)
771 PUSHIO(aword, *++argv, iof = nlchar); 771 PUSHIO(aword, *++argv, iof = nlchar);
772 break; 772 break;
773 773
774 case 'q': 774 case 'q':
775 qflag = SIG_DFL; 775 qflag = SIG_DFL;
776 break; 776 break;
@@ -784,7 +784,7 @@ extern int msh_main(int argc, char **argv)
784 setval(prompt, ""); 784 setval(prompt, "");
785 iof = linechar; 785 iof = linechar;
786 break; 786 break;
787 787
788 case 'i': 788 case 'i':
789 interactive++; 789 interactive++;
790 default: 790 default:
@@ -809,7 +809,7 @@ extern int msh_main(int argc, char **argv)
809 PUSHIO(afile, 0, iof); 809 PUSHIO(afile, 0, iof);
810 if (isatty(0) && isatty(1) && !cflag) { 810 if (isatty(0) && isatty(1) && !cflag) {
811 interactive++; 811 interactive++;
812#ifndef CONFIG_FEATURE_SH_EXTRA_QUIET 812#ifndef CONFIG_FEATURE_SH_EXTRA_QUIET
813 printf( "\n\n" BB_BANNER " Built-in shell (msh)\n"); 813 printf( "\n\n" BB_BANNER " Built-in shell (msh)\n");
814 printf( "Enter 'help' for a list of built-in commands.\n\n"); 814 printf( "Enter 'help' for a list of built-in commands.\n\n");
815#endif 815#endif
@@ -838,7 +838,7 @@ extern int msh_main(int argc, char **argv)
838 ap++; 838 ap++;
839 } 839 }
840 } 840 }
841 } 841 }
842 setval(lookup("#"), putn((--dolc < 0) ? (dolc = 0) : dolc)); 842 setval(lookup("#"), putn((--dolc < 0) ? (dolc = 0) : dolc));
843 843
844 for (;;) { 844 for (;;) {
@@ -2303,7 +2303,7 @@ int act;
2303#if __GNUC__ 2303#if __GNUC__
2304 /* Avoid longjmp clobbering */ 2304 /* Avoid longjmp clobbering */
2305 (void) &wp; 2305 (void) &wp;
2306#endif 2306#endif
2307 2307
2308 2308
2309 if (t == NULL) 2309 if (t == NULL)
@@ -2318,7 +2318,7 @@ int act;
2318 case TPAREN: 2318 case TPAREN:
2319 rv = execute(t->left, pin, pout, 0); 2319 rv = execute(t->left, pin, pout, 0);
2320 break; 2320 break;
2321 2321
2322 case TCOM: 2322 case TCOM:
2323 { 2323 {
2324 int child; 2324 int child;
@@ -2395,7 +2395,7 @@ int act;
2395 } else { 2395 } else {
2396 i = -1; 2396 i = -1;
2397 while (*wp++ != NULL) 2397 while (*wp++ != NULL)
2398 ; 2398 ;
2399 } 2399 }
2400 vp = lookup(t->str); 2400 vp = lookup(t->str);
2401 while (setjmp(bc.brkpt)) 2401 while (setjmp(bc.brkpt))
@@ -2497,7 +2497,7 @@ forkexec( register struct op *t, int *pin, int *pout, int act, char **wp, int *p
2497 (void) &cp; 2497 (void) &cp;
2498 (void) &resetsig; 2498 (void) &resetsig;
2499 (void) &owp; 2499 (void) &owp;
2500#endif 2500#endif
2501 2501
2502 owp = wp; 2502 owp = wp;
2503 resetsig = 0; 2503 resetsig = 0;
@@ -2532,7 +2532,7 @@ forkexec( register struct op *t, int *pin, int *pout, int act, char **wp, int *p
2532 hintr = intr; 2532 hintr = intr;
2533 hbrklist = brklist; 2533 hbrklist = brklist;
2534 hexecflg = execflg; 2534 hexecflg = execflg;
2535 2535
2536 i = vfork(); 2536 i = vfork();
2537 if (i != 0) { 2537 if (i != 0) {
2538 /* who wrote this crappy non vfork safe shit? */ 2538 /* who wrote this crappy non vfork safe shit? */
@@ -2563,7 +2563,7 @@ forkexec( register struct op *t, int *pin, int *pout, int act, char **wp, int *p
2563 (*pforked)++; 2563 (*pforked)++;
2564 brklist = 0; 2564 brklist = 0;
2565 execflg = 0; 2565 execflg = 0;
2566 } 2566 }
2567 if (owp != NULL) 2567 if (owp != NULL)
2568 while ((cp = *owp++) != NULL && assign(cp, COPYV)) 2568 while ((cp = *owp++) != NULL && assign(cp, COPYV))
2569 if (shcom == NULL) 2569 if (shcom == NULL)
@@ -2841,7 +2841,7 @@ char *c, **v, **envp;
2841#endif 2841#endif
2842 optind = 1; 2842 optind = 1;
2843 if (find_applet_by_name(name)) { 2843 if (find_applet_by_name(name)) {
2844 /* We have to exec here since we vforked. Running 2844 /* We have to exec here since we vforked. Running
2845 * run_applet_by_name() won't work and bad things 2845 * run_applet_by_name() won't work and bad things
2846 * will happen. */ 2846 * will happen. */
2847 execve("/proc/self/exe", v, envp); 2847 execve("/proc/self/exe", v, envp);
@@ -2964,8 +2964,8 @@ static int dohelp(struct op *t )
2964 for (i=0, applet = applets; i < NUM_APPLETS; applet++, i++) { 2964 for (i=0, applet = applets; i < NUM_APPLETS; applet++, i++) {
2965 if (!applet->name) 2965 if (!applet->name)
2966 continue; 2966 continue;
2967 2967
2968 col += printf("%s%s", ((col == 0) ? "\t" : " "), 2968 col += printf("%s%s", ((col == 0) ? "\t" : " "),
2969 applet->name); 2969 applet->name);
2970 if (col > 60) { 2970 if (col > 60) {
2971 printf("\n"); 2971 printf("\n");
@@ -3194,7 +3194,7 @@ register struct op *t;
3194 if (n == SIGINT) 3194 if (n == SIGINT)
3195 setsig(n, onintr); 3195 setsig(n, onintr);
3196 else 3196 else
3197 setsig(n, n == SIGQUIT ? SIG_IGN 3197 setsig(n, n == SIGQUIT ? SIG_IGN
3198 : SIG_DFL); 3198 : SIG_DFL);
3199 else 3199 else
3200 setsig(n, SIG_DFL); 3200 setsig(n, SIG_DFL);
@@ -3784,7 +3784,7 @@ int quoted;
3784 /* Avoid longjmp clobbering */ 3784 /* Avoid longjmp clobbering */
3785 (void) &cp; 3785 (void) &cp;
3786#endif 3786#endif
3787 3787
3788 for (cp = e.iop->argp->aword; *cp != '`'; cp++) 3788 for (cp = e.iop->argp->aword; *cp != '`'; cp++)
3789 if (*cp == 0) { 3789 if (*cp == 0) {
3790 err("no closing `"); 3790 err("no closing `");
@@ -3837,7 +3837,7 @@ int quoted;
3837 err("unclosed ${\n"); 3837 err("unclosed ${\n");
3838 return(0); 3838 return(0);
3839 } 3839 }
3840 if (operator) { 3840 if (operator) {
3841 src++; 3841 src++;
3842 while (*src && (*src != '}')) { 3842 while (*src && (*src != '}')) {
3843 alt_value[alt_index++] = *src++; 3843 alt_value[alt_index++] = *src++;
@@ -3875,7 +3875,7 @@ int quoted;
3875 } 3875 }
3876 } 3876 }
3877 *dest = '\0'; 3877 *dest = '\0';
3878 3878
3879 if (openpipe(pf) < 0) 3879 if (openpipe(pf) < 0)
3880 return(0); 3880 return(0);
3881 while ((i = vfork()) == -1 && errno == EAGAIN) 3881 while ((i = vfork()) == -1 && errno == EAGAIN)
@@ -3897,7 +3897,7 @@ int quoted;
3897 for (j=0; j<=_NSIG; j++) 3897 for (j=0; j<=_NSIG; j++)
3898 if (ourtrap[j] && signal(j, SIG_IGN) != SIG_IGN) 3898 if (ourtrap[j] && signal(j, SIG_IGN) != SIG_IGN)
3899 signal(j, SIG_DFL); 3899 signal(j, SIG_DFL);
3900 3900
3901 dup2(pf[1], 1); 3901 dup2(pf[1], 1);
3902 closepipe(pf); 3902 closepipe(pf);
3903 3903
@@ -4121,7 +4121,7 @@ register struct wdblock *wb;
4121 wb->w_words[wb->w_nword++] = wd; 4121 wb->w_words[wb->w_nword++] = wd;
4122 return(wb); 4122 return(wb);
4123} 4123}
4124static 4124static
4125char ** 4125char **
4126getwords(wb) 4126getwords(wb)
4127register struct wdblock *wb; 4127register struct wdblock *wb;
@@ -4557,7 +4557,7 @@ register struct ioarg *ap;
4557 c = mycommand[position]; 4557 c = mycommand[position];
4558 position++; 4558 position++;
4559 return(c); 4559 return(c);
4560 } else 4560 } else
4561#endif 4561#endif
4562 { 4562 {
4563 i = safe_read(ap->afile, &c, sizeof(c)); 4563 i = safe_read(ap->afile, &c, sizeof(c));
@@ -4858,7 +4858,7 @@ int xdoll;
4858 char c; 4858 char c;
4859 char tname[30] = ".msh_XXXXXX"; 4859 char tname[30] = ".msh_XXXXXX";
4860 jmp_buf ev; 4860 jmp_buf ev;
4861 4861
4862 tf = mkstemp(tname); 4862 tf = mkstemp(tname);
4863 if (tf < 0) 4863 if (tf < 0)
4864 return (-1); 4864 return (-1);
@@ -4917,24 +4917,24 @@ int area;
4917/* 4917/*
4918 * Copyright (c) 1987,1997, Prentice Hall 4918 * Copyright (c) 1987,1997, Prentice Hall
4919 * All rights reserved. 4919 * All rights reserved.
4920 * 4920 *
4921 * Redistribution and use of the MINIX operating system in source and 4921 * Redistribution and use of the MINIX operating system in source and
4922 * binary forms, with or without modification, are permitted provided 4922 * binary forms, with or without modification, are permitted provided
4923 * that the following conditions are met: 4923 * that the following conditions are met:
4924 * 4924 *
4925 * Redistributions of source code must retain the above copyright 4925 * Redistributions of source code must retain the above copyright
4926 * notice, this list of conditions and the following disclaimer. 4926 * notice, this list of conditions and the following disclaimer.
4927 * 4927 *
4928 * Redistributions in binary form must reproduce the above 4928 * Redistributions in binary form must reproduce the above
4929 * copyright notice, this list of conditions and the following 4929 * copyright notice, this list of conditions and the following
4930 * disclaimer in the documentation and/or other materials provided 4930 * disclaimer in the documentation and/or other materials provided
4931 * with the distribution. 4931 * with the distribution.
4932 * 4932 *
4933 * Neither the name of Prentice Hall nor the names of the software 4933 * Neither the name of Prentice Hall nor the names of the software
4934 * authors or contributors may be used to endorse or promote 4934 * authors or contributors may be used to endorse or promote
4935 * products derived from this software without specific prior 4935 * products derived from this software without specific prior
4936 * written permission. 4936 * written permission.
4937 * 4937 *
4938 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND 4938 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND
4939 * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, 4939 * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
4940 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 4940 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF