Applied patch from Larry Doolittle to fix '>\na\n' bug. Should close bug #1132
This commit is contained in:
parent
2892c35bdb
commit
44a9914709
11
lash.c
11
lash.c
@ -669,17 +669,22 @@ static void close_all()
|
|||||||
static void free_job(struct job *cmd)
|
static void free_job(struct job *cmd)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
struct jobset *keep;
|
||||||
|
|
||||||
for (i = 0; i < cmd->num_progs; i++) {
|
for (i = 0; i < cmd->num_progs; i++) {
|
||||||
free(cmd->progs[i].argv);
|
free(cmd->progs[i].argv);
|
||||||
if (cmd->progs[i].redirects)
|
if (cmd->progs[i].redirects)
|
||||||
free(cmd->progs[i].redirects);
|
free(cmd->progs[i].redirects);
|
||||||
}
|
}
|
||||||
free(cmd->progs);
|
if (cmd->progs)
|
||||||
|
free(cmd->progs);
|
||||||
if (cmd->text)
|
if (cmd->text)
|
||||||
free(cmd->text);
|
free(cmd->text);
|
||||||
free(cmd->cmdbuf);
|
if (cmd->cmdbuf)
|
||||||
|
free(cmd->cmdbuf);
|
||||||
|
keep = cmd->job_list;
|
||||||
memset(cmd, 0, sizeof(struct job));
|
memset(cmd, 0, sizeof(struct job));
|
||||||
|
cmd->job_list = keep;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* remove a job from the job_list */
|
/* remove a job from the job_list */
|
||||||
@ -1296,7 +1301,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg)
|
|||||||
chptr++;
|
chptr++;
|
||||||
|
|
||||||
if (!*chptr) {
|
if (!*chptr) {
|
||||||
error_msg("file name expected after %c", *src);
|
error_msg("file name expected after %c", *(src-1));
|
||||||
free_job(job);
|
free_job(job);
|
||||||
job->num_progs=0;
|
job->num_progs=0;
|
||||||
return 1;
|
return 1;
|
||||||
|
11
sh.c
11
sh.c
@ -669,17 +669,22 @@ static void close_all()
|
|||||||
static void free_job(struct job *cmd)
|
static void free_job(struct job *cmd)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
struct jobset *keep;
|
||||||
|
|
||||||
for (i = 0; i < cmd->num_progs; i++) {
|
for (i = 0; i < cmd->num_progs; i++) {
|
||||||
free(cmd->progs[i].argv);
|
free(cmd->progs[i].argv);
|
||||||
if (cmd->progs[i].redirects)
|
if (cmd->progs[i].redirects)
|
||||||
free(cmd->progs[i].redirects);
|
free(cmd->progs[i].redirects);
|
||||||
}
|
}
|
||||||
free(cmd->progs);
|
if (cmd->progs)
|
||||||
|
free(cmd->progs);
|
||||||
if (cmd->text)
|
if (cmd->text)
|
||||||
free(cmd->text);
|
free(cmd->text);
|
||||||
free(cmd->cmdbuf);
|
if (cmd->cmdbuf)
|
||||||
|
free(cmd->cmdbuf);
|
||||||
|
keep = cmd->job_list;
|
||||||
memset(cmd, 0, sizeof(struct job));
|
memset(cmd, 0, sizeof(struct job));
|
||||||
|
cmd->job_list = keep;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* remove a job from the job_list */
|
/* remove a job from the job_list */
|
||||||
@ -1296,7 +1301,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg)
|
|||||||
chptr++;
|
chptr++;
|
||||||
|
|
||||||
if (!*chptr) {
|
if (!*chptr) {
|
||||||
error_msg("file name expected after %c", *src);
|
error_msg("file name expected after %c", *(src-1));
|
||||||
free_job(job);
|
free_job(job);
|
||||||
job->num_progs=0;
|
job->num_progs=0;
|
||||||
return 1;
|
return 1;
|
||||||
|
11
shell/lash.c
11
shell/lash.c
@ -669,17 +669,22 @@ static void close_all()
|
|||||||
static void free_job(struct job *cmd)
|
static void free_job(struct job *cmd)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
struct jobset *keep;
|
||||||
|
|
||||||
for (i = 0; i < cmd->num_progs; i++) {
|
for (i = 0; i < cmd->num_progs; i++) {
|
||||||
free(cmd->progs[i].argv);
|
free(cmd->progs[i].argv);
|
||||||
if (cmd->progs[i].redirects)
|
if (cmd->progs[i].redirects)
|
||||||
free(cmd->progs[i].redirects);
|
free(cmd->progs[i].redirects);
|
||||||
}
|
}
|
||||||
free(cmd->progs);
|
if (cmd->progs)
|
||||||
|
free(cmd->progs);
|
||||||
if (cmd->text)
|
if (cmd->text)
|
||||||
free(cmd->text);
|
free(cmd->text);
|
||||||
free(cmd->cmdbuf);
|
if (cmd->cmdbuf)
|
||||||
|
free(cmd->cmdbuf);
|
||||||
|
keep = cmd->job_list;
|
||||||
memset(cmd, 0, sizeof(struct job));
|
memset(cmd, 0, sizeof(struct job));
|
||||||
|
cmd->job_list = keep;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* remove a job from the job_list */
|
/* remove a job from the job_list */
|
||||||
@ -1296,7 +1301,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg)
|
|||||||
chptr++;
|
chptr++;
|
||||||
|
|
||||||
if (!*chptr) {
|
if (!*chptr) {
|
||||||
error_msg("file name expected after %c", *src);
|
error_msg("file name expected after %c", *(src-1));
|
||||||
free_job(job);
|
free_job(job);
|
||||||
job->num_progs=0;
|
job->num_progs=0;
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user