aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authoraaronl <aaronl@69ca8d6d-28ef-0310-b511-8ec308f3f277>2002-11-28 11:27:31 +0000
committeraaronl <aaronl@69ca8d6d-28ef-0310-b511-8ec308f3f277>2002-11-28 11:27:31 +0000
commit59b0f5c27b3eec8ce589d520b5a13cd3db0d8203 (patch)
treecda2b13f10ca1ab0a3559d4b6ff663ed20d7106c /shell
parentb93e459224de0e63b0dcfb691aecbefac4bf665a (diff)
downloadbusybox-w32-59b0f5c27b3eec8ce589d520b5a13cd3db0d8203.tar.gz
busybox-w32-59b0f5c27b3eec8ce589d520b5a13cd3db0d8203.tar.bz2
busybox-w32-59b0f5c27b3eec8ce589d520b5a13cd3db0d8203.zip
Change if(x)free(x); to free(x);
git-svn-id: svn://busybox.net/trunk/busybox@6055 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'shell')
-rw-r--r--shell/hush.c5
-rw-r--r--shell/lash.c12
2 files changed, 6 insertions, 11 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 08b3b295f..48d1d1458 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -810,7 +810,7 @@ static void b_reset(o_string *o)
810static void b_free(o_string *o) 810static void b_free(o_string *o)
811{ 811{
812 b_reset(o); 812 b_reset(o);
813 if (o->data != NULL) free(o->data); 813 free(o->data);
814 o->data = NULL; 814 o->data = NULL;
815 o->maxlen = 0; 815 o->maxlen = 0;
816} 816}
@@ -880,8 +880,7 @@ static inline void setup_prompt_string(int promptmode, char **prompt_str)
880#ifndef CONFIG_FEATURE_SH_FANCY_PROMPT 880#ifndef CONFIG_FEATURE_SH_FANCY_PROMPT
881 /* Set up the prompt */ 881 /* Set up the prompt */
882 if (promptmode == 1) { 882 if (promptmode == 1) {
883 if (PS1) 883 free(PS1);
884 free(PS1);
885 PS1=xmalloc(strlen(cwd)+4); 884 PS1=xmalloc(strlen(cwd)+4);
886 sprintf(PS1, "%s %s", cwd, ( geteuid() != 0 ) ? "$ ":"# "); 885 sprintf(PS1, "%s %s", cwd, ( geteuid() != 0 ) ? "$ ":"# ");
887 *prompt_str = PS1; 886 *prompt_str = PS1;
diff --git a/shell/lash.c b/shell/lash.c
index 7994d2620..c4d6ef04e 100644
--- a/shell/lash.c
+++ b/shell/lash.c
@@ -518,12 +518,9 @@ static void free_job(struct job *cmd)
518 if (cmd->progs[i].redirects) 518 if (cmd->progs[i].redirects)
519 free(cmd->progs[i].redirects); 519 free(cmd->progs[i].redirects);
520 } 520 }
521 if (cmd->progs) 521 free(cmd->progs);
522 free(cmd->progs); 522 free(cmd->text);
523 if (cmd->text) 523 free(cmd->cmdbuf);
524 free(cmd->text);
525 if (cmd->cmdbuf)
526 free(cmd->cmdbuf);
527 keep = cmd->job_list; 524 keep = cmd->job_list;
528 memset(cmd, 0, sizeof(struct job)); 525 memset(cmd, 0, sizeof(struct job));
529 cmd->job_list = keep; 526 cmd->job_list = keep;
@@ -677,8 +674,7 @@ static inline void setup_prompt_string(char **prompt_str)
677#ifndef CONFIG_FEATURE_SH_FANCY_PROMPT 674#ifndef CONFIG_FEATURE_SH_FANCY_PROMPT
678 /* Set up the prompt */ 675 /* Set up the prompt */
679 if (shell_context == 0) { 676 if (shell_context == 0) {
680 if (PS1) 677 free(PS1);
681 free(PS1);
682 PS1=xmalloc(strlen(cwd)+4); 678 PS1=xmalloc(strlen(cwd)+4);
683 sprintf(PS1, "%s %s", cwd, ( geteuid() != 0 ) ? "$ ":"# "); 679 sprintf(PS1, "%s %s", cwd, ( geteuid() != 0 ) ? "$ ":"# ");
684 *prompt_str = PS1; 680 *prompt_str = PS1;