diff options
author | "Vladimir N. Oleynik" <dzo@simtreas.ru> | 2005-10-17 09:48:57 +0000 |
---|---|---|
committer | "Vladimir N. Oleynik" <dzo@simtreas.ru> | 2005-10-17 09:48:57 +0000 |
commit | 485d7cbdf1e6c09cdd40d66edf6e4098cc0670be (patch) | |
tree | 03ad675eeb819364d26be61d9083a764c41c555f | |
parent | a4d45d423fe7f80e61bae14323254f73ac9888a0 (diff) | |
download | busybox-w32-485d7cbdf1e6c09cdd40d66edf6e4098cc0670be.tar.gz busybox-w32-485d7cbdf1e6c09cdd40d66edf6e4098cc0670be.tar.bz2 busybox-w32-485d7cbdf1e6c09cdd40d66edf6e4098cc0670be.zip |
data --> text
-rw-r--r-- | shell/hush.c | 14 | ||||
-rw-r--r-- | shell/msh.c | 14 |
2 files changed, 14 insertions, 14 deletions
diff --git a/shell/hush.c b/shell/hush.c index 87b9412b3..ffc4685d6 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -133,7 +133,7 @@ typedef enum { | |||
133 | 133 | ||
134 | /* The descrip member of this structure is only used to make debugging | 134 | /* The descrip member of this structure is only used to make debugging |
135 | * output pretty */ | 135 | * output pretty */ |
136 | static struct {int mode; int default_fd; char *descrip;} redir_table[] = { | 136 | static const struct {int mode; int default_fd; const char *descrip;} redir_table[] = { |
137 | { 0, 0, "()" }, | 137 | { 0, 0, "()" }, |
138 | { O_RDONLY, 0, "<" }, | 138 | { O_RDONLY, 0, "<" }, |
139 | { O_CREAT|O_TRUNC|O_WRONLY, 1, ">" }, | 139 | { O_CREAT|O_TRUNC|O_WRONLY, 1, ">" }, |
@@ -297,8 +297,8 @@ struct in_str { | |||
297 | #define JOB_STATUS_FORMAT "[%d] %-22s %.40s\n" | 297 | #define JOB_STATUS_FORMAT "[%d] %-22s %.40s\n" |
298 | 298 | ||
299 | struct built_in_command { | 299 | struct built_in_command { |
300 | char *cmd; /* name */ | 300 | const char *cmd; /* name */ |
301 | char *descr; /* description */ | 301 | const char *descr; /* description */ |
302 | int (*function) (struct child_prog *); /* function ptr */ | 302 | int (*function) (struct child_prog *); /* function ptr */ |
303 | }; | 303 | }; |
304 | 304 | ||
@@ -414,7 +414,7 @@ static int set_local_var(const char *s, int flg_export); | |||
414 | * in the parent shell process. If forked, of course they can not. | 414 | * in the parent shell process. If forked, of course they can not. |
415 | * For example, 'unset foo | whatever' will parse and run, but foo will | 415 | * For example, 'unset foo | whatever' will parse and run, but foo will |
416 | * still be set at the end. */ | 416 | * still be set at the end. */ |
417 | static struct built_in_command bltins[] = { | 417 | static const struct built_in_command bltins[] = { |
418 | {"bg", "Resume a job in the background", builtin_fg_bg}, | 418 | {"bg", "Resume a job in the background", builtin_fg_bg}, |
419 | {"break", "Exit for, while or until loop", builtin_not_written}, | 419 | {"break", "Exit for, while or until loop", builtin_not_written}, |
420 | {"cd", "Change working directory", builtin_cd}, | 420 | {"cd", "Change working directory", builtin_cd}, |
@@ -618,7 +618,7 @@ static int builtin_fg_bg(struct child_prog *child) | |||
618 | /* built-in 'help' handler */ | 618 | /* built-in 'help' handler */ |
619 | static int builtin_help(struct child_prog *dummy) | 619 | static int builtin_help(struct child_prog *dummy) |
620 | { | 620 | { |
621 | struct built_in_command *x; | 621 | const struct built_in_command *x; |
622 | 622 | ||
623 | printf("\nBuilt-in commands:\n"); | 623 | printf("\nBuilt-in commands:\n"); |
624 | printf("-------------------\n"); | 624 | printf("-------------------\n"); |
@@ -1076,7 +1076,7 @@ static void pseudo_exec(struct child_prog *child) | |||
1076 | { | 1076 | { |
1077 | int i, rcode; | 1077 | int i, rcode; |
1078 | char *p; | 1078 | char *p; |
1079 | struct built_in_command *x; | 1079 | const struct built_in_command *x; |
1080 | if (child->argv) { | 1080 | if (child->argv) { |
1081 | for (i=0; is_assignment(child->argv[i]); i++) { | 1081 | for (i=0; is_assignment(child->argv[i]); i++) { |
1082 | debug_printf("pid %d environment modification: %s\n",getpid(),child->argv[i]); | 1082 | debug_printf("pid %d environment modification: %s\n",getpid(),child->argv[i]); |
@@ -1338,7 +1338,7 @@ static int run_pipe_real(struct pipe *pi) | |||
1338 | int nextin, nextout; | 1338 | int nextin, nextout; |
1339 | int pipefds[2]; /* pipefds[0] is for reading */ | 1339 | int pipefds[2]; /* pipefds[0] is for reading */ |
1340 | struct child_prog *child; | 1340 | struct child_prog *child; |
1341 | struct built_in_command *x; | 1341 | const struct built_in_command *x; |
1342 | char *p; | 1342 | char *p; |
1343 | 1343 | ||
1344 | nextin = 0; | 1344 | nextin = 0; |
diff --git a/shell/msh.c b/shell/msh.c index 30ebc7a3a..9e9a10b9f 100644 --- a/shell/msh.c +++ b/shell/msh.c | |||
@@ -514,7 +514,7 @@ static int eofc(void); | |||
514 | static int readc(void); | 514 | static int readc(void); |
515 | static void unget(int c); | 515 | static void unget(int c); |
516 | static void ioecho(int c); | 516 | static void ioecho(int c); |
517 | static void prs(char *s); | 517 | static void prs(const char *s); |
518 | static void prn(unsigned u); | 518 | static void prn(unsigned u); |
519 | static void closef(int i); | 519 | static void closef(int i); |
520 | static void closeall(void); | 520 | static void closeall(void); |
@@ -622,7 +622,7 @@ struct here { | |||
622 | struct here *h_next; | 622 | struct here *h_next; |
623 | }; | 623 | }; |
624 | 624 | ||
625 | static char *signame[] = { | 625 | static const char * const signame[] = { |
626 | "Signal 0", | 626 | "Signal 0", |
627 | "Hangup", | 627 | "Hangup", |
628 | (char *) NULL, /* interrupt */ | 628 | (char *) NULL, /* interrupt */ |
@@ -644,10 +644,10 @@ static char *signame[] = { | |||
644 | #define NSIGNAL (sizeof(signame)/sizeof(signame[0])) | 644 | #define NSIGNAL (sizeof(signame)/sizeof(signame[0])) |
645 | 645 | ||
646 | struct res { | 646 | struct res { |
647 | char *r_name; | 647 | const char *r_name; |
648 | int r_val; | 648 | int r_val; |
649 | }; | 649 | }; |
650 | static struct res restab[] = { | 650 | static const struct res restab[] = { |
651 | {"for", FOR}, | 651 | {"for", FOR}, |
652 | {"case", CASE}, | 652 | {"case", CASE}, |
653 | {"esac", ESAC}, | 653 | {"esac", ESAC}, |
@@ -709,7 +709,7 @@ static char **dolv; | |||
709 | static int dolc; | 709 | static int dolc; |
710 | static int exstat; | 710 | static int exstat; |
711 | static char gflg; | 711 | static char gflg; |
712 | static int interactive = 0; /* Is this an interactive shell */ | 712 | static int interactive; /* Is this an interactive shell */ |
713 | static int execflg; | 713 | static int execflg; |
714 | static int multiline; /* \n changed to ; */ | 714 | static int multiline; /* \n changed to ; */ |
715 | static struct op *outtree; /* result from parser */ | 715 | static struct op *outtree; /* result from parser */ |
@@ -2245,7 +2245,7 @@ char **wp; | |||
2245 | static int rlookup(n) | 2245 | static int rlookup(n) |
2246 | REGISTER char *n; | 2246 | REGISTER char *n; |
2247 | { | 2247 | { |
2248 | REGISTER struct res *rp; | 2248 | REGISTER const struct res *rp; |
2249 | 2249 | ||
2250 | DBGPRINTF7(("RLOOKUP: enter, n is %s\n", n)); | 2250 | DBGPRINTF7(("RLOOKUP: enter, n is %s\n", n)); |
2251 | 2251 | ||
@@ -5166,7 +5166,7 @@ REGISTER struct ioarg *ap; | |||
5166 | } | 5166 | } |
5167 | 5167 | ||
5168 | static void prs(s) | 5168 | static void prs(s) |
5169 | REGISTER char *s; | 5169 | REGISTER const char *s; |
5170 | { | 5170 | { |
5171 | if (*s) | 5171 | if (*s) |
5172 | write(2, s, strlen(s)); | 5172 | write(2, s, strlen(s)); |