diff options
author | Aaron Lehmann <aaronl@vitelius.com> | 2002-11-28 11:27:31 +0000 |
---|---|---|
committer | Aaron Lehmann <aaronl@vitelius.com> | 2002-11-28 11:27:31 +0000 |
commit | a170e1c858d35c474ceb9fecb41b37d681424094 (patch) | |
tree | cda2b13f10ca1ab0a3559d4b6ff663ed20d7106c /shell/hush.c | |
parent | 1652855fbc830f41c7ee56ece1a30b328c4fb395 (diff) | |
download | busybox-w32-a170e1c858d35c474ceb9fecb41b37d681424094.tar.gz busybox-w32-a170e1c858d35c474ceb9fecb41b37d681424094.tar.bz2 busybox-w32-a170e1c858d35c474ceb9fecb41b37d681424094.zip |
Change if(x)free(x); to free(x);
Diffstat (limited to 'shell/hush.c')
-rw-r--r-- | shell/hush.c | 5 |
1 files changed, 2 insertions, 3 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) | |||
810 | static void b_free(o_string *o) | 810 | static 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; |