Patch from vodz to fix freeing a static in cmdedit.
authorEric Andersen <andersen@codepoet.org>
Mon, 2 Jul 2001 15:36:57 +0000 (15:36 -0000)
committerEric Andersen <andersen@codepoet.org>
Mon, 2 Jul 2001 15:36:57 +0000 (15:36 -0000)
cmdedit.c
shell/cmdedit.c

index 981253db1638e01048043054c00b42c4b0507d8d..4f124d6475989e4e0bc804e35c8669000455ae6f 100644 (file)
--- a/cmdedit.c
+++ b/cmdedit.c
@@ -442,7 +442,8 @@ static void parse_prompt(const char *prmt_ptr)
                if (flg_not_length == ']')
                        sub_len++;
        }
-       free(pwd_buf);
+       if(pwd_buf!=(char *)unknown)
+               free(pwd_buf);
        cmdedit_prompt = prmt_mem_ptr;
        cmdedit_prmt_len = prmt_len - sub_len;
        put_prompt();
index 981253db1638e01048043054c00b42c4b0507d8d..4f124d6475989e4e0bc804e35c8669000455ae6f 100644 (file)
@@ -442,7 +442,8 @@ static void parse_prompt(const char *prmt_ptr)
                if (flg_not_length == ']')
                        sub_len++;
        }
-       free(pwd_buf);
+       if(pwd_buf!=(char *)unknown)
+               free(pwd_buf);
        cmdedit_prompt = prmt_mem_ptr;
        cmdedit_prmt_len = prmt_len - sub_len;
        put_prompt();