• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/busybox/0003-ash-recursive-heredocs.patch
Gustavo ZacariasGustavo Zacarias committed 157dc65fb7425 Mar 2016
Raw file
Source viewDiff to previous
 
1
From 4194c2875310c13ee3ca2bb0e1aea6a2ae67c55a Mon Sep 17 00:00:00 2001
2
From: Ron Yorston <rmy@pobox.com>
3
Date: Thu, 29 Oct 2015 16:44:56 +0000
4
Subject: [PATCH] ash: fix error during recursive processing of here document
5
​
6
Save the value of the checkkwd flag to prevent it being clobbered
7
during recursion.
8
​
9
Based on commit ec2c84d from git://git.kernel.org/pub/scm/utils/dash/dash.git
10
by Herbert Xu.
11
​
12
function                                             old     new   delta
13
readtoken                                            190     203     +13
14
------------------------------------------------------------------------------
15
(add/remove: 0/0 grow/shrink: 1/0 up/down: 13/0)               Total: 13 bytes
16
​
17
Signed-off-by: Ron Yorston <rmy@pobox.com>
18
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
19
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
20
(cherry picked from commit 713f07d906d9171953be0c12e2369869855b6ca6)
21
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
22
---
23
 shell/ash.c                               | 5 +++--
24
 shell/ash_test/ash-heredoc/heredoc3.right | 1 +
25
 shell/ash_test/ash-heredoc/heredoc3.tests | 9 +++++++++
26
 3 files changed, 13 insertions(+), 2 deletions(-)
27
 create mode 100644 shell/ash_test/ash-heredoc/heredoc3.right
28
 create mode 100755 shell/ash_test/ash-heredoc/heredoc3.tests
29
​
30
diff --git a/shell/ash.c b/shell/ash.c
31
index 8a1628e..256e933 100644
32
--- a/shell/ash.c
33
+++ b/shell/ash.c
34
@@ -11893,6 +11893,7 @@ static int
35
 readtoken(void)
36
 {
37
    int t;
38
+   int kwd = checkkwd;
39
 #if DEBUG
40
    smallint alreadyseen = tokpushback;
41
 #endif
42
@@ -11906,7 +11907,7 @@ readtoken(void)
43
    /*
44
     * eat newlines
45
     */
46
-   if (checkkwd & CHKNL) {
47
+   if (kwd & CHKNL) {
48
        while (t == TNL) {
49
            parseheredoc();
50
            t = xxreadtoken();
51
@@ -11920,7 +11921,7 @@ readtoken(void)
52
    /*
53
     * check for keywords
54
     */
55
-   if (checkkwd & CHKKWD) {
56
+   if (kwd & CHKKWD) {
57
        const char *const *pp;
58
 
59
        pp = findkwd(wordtext);
60
diff --git a/shell/ash_test/ash-heredoc/heredoc3.right b/shell/ash_test/ash-heredoc/heredoc3.right
61
new file mode 100644
62
index 0000000..ce01362
63
--- /dev/null
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.