ash: replace xstrdup (shell shall not die)

grep: fix mis-indented block
This commit is contained in:
Denis Vlasenko
2007-02-25 02:37:49 +00:00
parent 018e085d44
commit 4222ae440a
2 changed files with 52 additions and 52 deletions

View File

@@ -84,7 +84,7 @@ static int last_line_printed;
static llist_t *pattern_head; /* growable list of patterns to match */ static llist_t *pattern_head; /* growable list of patterns to match */
static const char *cur_file; /* the current file we are reading */ static const char *cur_file; /* the current file we are reading */
typedef struct GREP_LIST_DATA { typedef struct grep_list_data_t {
char *pattern; char *pattern;
regex_t preg; regex_t preg;
#define PATTERN_MEM_A 1 #define PATTERN_MEM_A 1

View File

@@ -2156,7 +2156,7 @@ putprompt(const char *s)
{ {
if (ENABLE_ASH_EXPAND_PRMT) { if (ENABLE_ASH_EXPAND_PRMT) {
free((char*)cmdedit_prompt); free((char*)cmdedit_prompt);
cmdedit_prompt = xstrdup(s); cmdedit_prompt = ckstrdup(s);
return; return;
} }
cmdedit_prompt = s; cmdedit_prompt = s;
@@ -11033,7 +11033,7 @@ dotcmd(int argc, char **argv)
int status = 0; int status = 0;
for (sp = cmdenviron; sp; sp = sp->next) for (sp = cmdenviron; sp; sp = sp->next)
setvareq(xstrdup(sp->text), VSTRFIXED | VTEXTFIXED); setvareq(ckstrdup(sp->text), VSTRFIXED | VTEXTFIXED);
if (argc >= 2) { /* That's what SVR2 does */ if (argc >= 2) { /* That's what SVR2 does */
char *fullname; char *fullname;