diff options
author | Ron Yorston <rmy@pobox.com> | 2013-02-07 14:25:54 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2013-02-07 14:25:54 +0000 |
commit | b604585914e032b28bef3e337a978e56a9069cda (patch) | |
tree | b2ee0a3fb38d10397c602d0fe215ea3bbbf334c0 /shell/ash.c | |
parent | 0eda07c7ff8cf1fc11bc1bda5383f884d7adf031 (diff) | |
parent | ba76b7a40b929878833731f76306b1c977cc8650 (diff) | |
download | busybox-w32-b604585914e032b28bef3e337a978e56a9069cda.tar.gz busybox-w32-b604585914e032b28bef3e337a978e56a9069cda.tar.bz2 busybox-w32-b604585914e032b28bef3e337a978e56a9069cda.zip |
Merge branch 'busybox' into merge
Diffstat (limited to 'shell/ash.c')
-rw-r--r-- | shell/ash.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/shell/ash.c b/shell/ash.c index 7a50e73f3..75c01ec14 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -3737,7 +3737,8 @@ set_curjob(struct job *jp, unsigned mode) | |||
3737 | break; | 3737 | break; |
3738 | case CUR_RUNNING: | 3738 | case CUR_RUNNING: |
3739 | /* newly created job or backgrounded job, | 3739 | /* newly created job or backgrounded job, |
3740 | put after all stopped jobs. */ | 3740 | * put after all stopped jobs. |
3741 | */ | ||
3741 | while (1) { | 3742 | while (1) { |
3742 | jp1 = *jpp; | 3743 | jp1 = *jpp; |
3743 | #if JOBS | 3744 | #if JOBS |
@@ -9101,8 +9102,17 @@ expredir(union node *n) | |||
9101 | #if ENABLE_ASH_BASH_COMPAT | 9102 | #if ENABLE_ASH_BASH_COMPAT |
9102 | store_expfname: | 9103 | store_expfname: |
9103 | #endif | 9104 | #endif |
9105 | #if 0 | ||
9106 | // By the design of stack allocator, the loop of this kind: | ||
9107 | // while true; do while true; do break; done </dev/null; done | ||
9108 | // will look like a memory leak: ash plans to free expfname's | ||
9109 | // of "/dev/null" as soon as it finishes running the loop | ||
9110 | // (in this case, never). | ||
9111 | // This "fix" is wrong: | ||
9104 | if (redir->nfile.expfname) | 9112 | if (redir->nfile.expfname) |
9105 | stunalloc(redir->nfile.expfname); | 9113 | stunalloc(redir->nfile.expfname); |
9114 | // It results in corrupted state of stacked allocations. | ||
9115 | #endif | ||
9106 | redir->nfile.expfname = fn.list->text; | 9116 | redir->nfile.expfname = fn.list->text; |
9107 | break; | 9117 | break; |
9108 | case NFROMFD: | 9118 | case NFROMFD: |
@@ -12138,8 +12148,9 @@ parsebackq: { | |||
12138 | INT_ON; | 12148 | INT_ON; |
12139 | if (oldstyle) { | 12149 | if (oldstyle) { |
12140 | /* We must read until the closing backquote, giving special | 12150 | /* We must read until the closing backquote, giving special |
12141 | treatment to some slashes, and then push the string and | 12151 | * treatment to some slashes, and then push the string and |
12142 | reread it as input, interpreting it normally. */ | 12152 | * reread it as input, interpreting it normally. |
12153 | */ | ||
12143 | char *pout; | 12154 | char *pout; |
12144 | size_t psavelen; | 12155 | size_t psavelen; |
12145 | char *pstr; | 12156 | char *pstr; |