mirror of
https://github.com/sheumann/hush.git
synced 2024-09-12 00:55:11 +00:00
data --> text
This commit is contained in:
parent
a4d45d423f
commit
485d7cbdf1
14
shell/hush.c
14
shell/hush.c
@ -133,7 +133,7 @@ typedef enum {
|
|||||||
|
|
||||||
/* The descrip member of this structure is only used to make debugging
|
/* The descrip member of this structure is only used to make debugging
|
||||||
* output pretty */
|
* output pretty */
|
||||||
static struct {int mode; int default_fd; char *descrip;} redir_table[] = {
|
static const struct {int mode; int default_fd; const char *descrip;} redir_table[] = {
|
||||||
{ 0, 0, "()" },
|
{ 0, 0, "()" },
|
||||||
{ O_RDONLY, 0, "<" },
|
{ O_RDONLY, 0, "<" },
|
||||||
{ O_CREAT|O_TRUNC|O_WRONLY, 1, ">" },
|
{ O_CREAT|O_TRUNC|O_WRONLY, 1, ">" },
|
||||||
@ -297,8 +297,8 @@ struct in_str {
|
|||||||
#define JOB_STATUS_FORMAT "[%d] %-22s %.40s\n"
|
#define JOB_STATUS_FORMAT "[%d] %-22s %.40s\n"
|
||||||
|
|
||||||
struct built_in_command {
|
struct built_in_command {
|
||||||
char *cmd; /* name */
|
const char *cmd; /* name */
|
||||||
char *descr; /* description */
|
const char *descr; /* description */
|
||||||
int (*function) (struct child_prog *); /* function ptr */
|
int (*function) (struct child_prog *); /* function ptr */
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -414,7 +414,7 @@ static int set_local_var(const char *s, int flg_export);
|
|||||||
* in the parent shell process. If forked, of course they can not.
|
* in the parent shell process. If forked, of course they can not.
|
||||||
* For example, 'unset foo | whatever' will parse and run, but foo will
|
* For example, 'unset foo | whatever' will parse and run, but foo will
|
||||||
* still be set at the end. */
|
* still be set at the end. */
|
||||||
static struct built_in_command bltins[] = {
|
static const struct built_in_command bltins[] = {
|
||||||
{"bg", "Resume a job in the background", builtin_fg_bg},
|
{"bg", "Resume a job in the background", builtin_fg_bg},
|
||||||
{"break", "Exit for, while or until loop", builtin_not_written},
|
{"break", "Exit for, while or until loop", builtin_not_written},
|
||||||
{"cd", "Change working directory", builtin_cd},
|
{"cd", "Change working directory", builtin_cd},
|
||||||
@ -618,7 +618,7 @@ static int builtin_fg_bg(struct child_prog *child)
|
|||||||
/* built-in 'help' handler */
|
/* built-in 'help' handler */
|
||||||
static int builtin_help(struct child_prog *dummy)
|
static int builtin_help(struct child_prog *dummy)
|
||||||
{
|
{
|
||||||
struct built_in_command *x;
|
const struct built_in_command *x;
|
||||||
|
|
||||||
printf("\nBuilt-in commands:\n");
|
printf("\nBuilt-in commands:\n");
|
||||||
printf("-------------------\n");
|
printf("-------------------\n");
|
||||||
@ -1076,7 +1076,7 @@ static void pseudo_exec(struct child_prog *child)
|
|||||||
{
|
{
|
||||||
int i, rcode;
|
int i, rcode;
|
||||||
char *p;
|
char *p;
|
||||||
struct built_in_command *x;
|
const struct built_in_command *x;
|
||||||
if (child->argv) {
|
if (child->argv) {
|
||||||
for (i=0; is_assignment(child->argv[i]); i++) {
|
for (i=0; is_assignment(child->argv[i]); i++) {
|
||||||
debug_printf("pid %d environment modification: %s\n",getpid(),child->argv[i]);
|
debug_printf("pid %d environment modification: %s\n",getpid(),child->argv[i]);
|
||||||
@ -1338,7 +1338,7 @@ static int run_pipe_real(struct pipe *pi)
|
|||||||
int nextin, nextout;
|
int nextin, nextout;
|
||||||
int pipefds[2]; /* pipefds[0] is for reading */
|
int pipefds[2]; /* pipefds[0] is for reading */
|
||||||
struct child_prog *child;
|
struct child_prog *child;
|
||||||
struct built_in_command *x;
|
const struct built_in_command *x;
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
nextin = 0;
|
nextin = 0;
|
||||||
|
14
shell/msh.c
14
shell/msh.c
@ -514,7 +514,7 @@ static int eofc(void);
|
|||||||
static int readc(void);
|
static int readc(void);
|
||||||
static void unget(int c);
|
static void unget(int c);
|
||||||
static void ioecho(int c);
|
static void ioecho(int c);
|
||||||
static void prs(char *s);
|
static void prs(const char *s);
|
||||||
static void prn(unsigned u);
|
static void prn(unsigned u);
|
||||||
static void closef(int i);
|
static void closef(int i);
|
||||||
static void closeall(void);
|
static void closeall(void);
|
||||||
@ -622,7 +622,7 @@ struct here {
|
|||||||
struct here *h_next;
|
struct here *h_next;
|
||||||
};
|
};
|
||||||
|
|
||||||
static char *signame[] = {
|
static const char * const signame[] = {
|
||||||
"Signal 0",
|
"Signal 0",
|
||||||
"Hangup",
|
"Hangup",
|
||||||
(char *) NULL, /* interrupt */
|
(char *) NULL, /* interrupt */
|
||||||
@ -644,10 +644,10 @@ static char *signame[] = {
|
|||||||
#define NSIGNAL (sizeof(signame)/sizeof(signame[0]))
|
#define NSIGNAL (sizeof(signame)/sizeof(signame[0]))
|
||||||
|
|
||||||
struct res {
|
struct res {
|
||||||
char *r_name;
|
const char *r_name;
|
||||||
int r_val;
|
int r_val;
|
||||||
};
|
};
|
||||||
static struct res restab[] = {
|
static const struct res restab[] = {
|
||||||
{"for", FOR},
|
{"for", FOR},
|
||||||
{"case", CASE},
|
{"case", CASE},
|
||||||
{"esac", ESAC},
|
{"esac", ESAC},
|
||||||
@ -709,7 +709,7 @@ static char **dolv;
|
|||||||
static int dolc;
|
static int dolc;
|
||||||
static int exstat;
|
static int exstat;
|
||||||
static char gflg;
|
static char gflg;
|
||||||
static int interactive = 0; /* Is this an interactive shell */
|
static int interactive; /* Is this an interactive shell */
|
||||||
static int execflg;
|
static int execflg;
|
||||||
static int multiline; /* \n changed to ; */
|
static int multiline; /* \n changed to ; */
|
||||||
static struct op *outtree; /* result from parser */
|
static struct op *outtree; /* result from parser */
|
||||||
@ -2245,7 +2245,7 @@ char **wp;
|
|||||||
static int rlookup(n)
|
static int rlookup(n)
|
||||||
REGISTER char *n;
|
REGISTER char *n;
|
||||||
{
|
{
|
||||||
REGISTER struct res *rp;
|
REGISTER const struct res *rp;
|
||||||
|
|
||||||
DBGPRINTF7(("RLOOKUP: enter, n is %s\n", n));
|
DBGPRINTF7(("RLOOKUP: enter, n is %s\n", n));
|
||||||
|
|
||||||
@ -5166,7 +5166,7 @@ REGISTER struct ioarg *ap;
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void prs(s)
|
static void prs(s)
|
||||||
REGISTER char *s;
|
REGISTER const char *s;
|
||||||
{
|
{
|
||||||
if (*s)
|
if (*s)
|
||||||
write(2, s, strlen(s));
|
write(2, s, strlen(s));
|
||||||
|
Loading…
Reference in New Issue
Block a user