On Wed, Feb 26, 2014 at 3:47 AM, Arne Goedeke <e...@laramies.com> wrote:
> My gentoo /bin/sh (which is bash) unlike dash generates a broken
> whitespace.h file from the current bin/getwhitespace.sh . I dont know
> which of the two is wrong here, but should we simply use numeric values
> instead of character escapes?
>
> arne

There's a difference between bash and dash handling there. I suspect
the easiest solution will be to switch to a heredoc, which - not being
a quoted string itself - doesn't parse apostrophes. It's not as tidy
as the other version, though.

Patch attached.

ChrisA
From e3f00ee7de4ed2e72c025e998acdf0af6373f076 Mon Sep 17 00:00:00 2001
From: Chris Angelico <ros...@gmail.com>
Date: Wed, 26 Feb 2014 04:02:31 +1100
Subject: [PATCH] Rework bin/getwhitespace.sh to use a heredoc for dash/bash
 compatibility

This reverts commit 19e464ce97f8b3ac796c87fe0cdac279961aaf40.
---
 bin/getwhitespace.sh |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/bin/getwhitespace.sh b/bin/getwhitespace.sh
index 213b16f..e9cda72 100755
--- a/bin/getwhitespace.sh
+++ b/bin/getwhitespace.sh
@@ -1,12 +1,13 @@
 #!/bin/sh
 
-echo "/* File generated on `date`
+echo "/* File generated on `date`"
+cat <<'EOM'
 by getwhitespace <UnicodeData.txt */
 
 #define SPACECASE8							\\
-       case ' ':case '\\\\t':case '\\\\r':case '\\\\n':case '\\\\v':case '\\\\f':	\\
+       case ' ':case '\\t':case '\\r':case '\\n':case '\\v':case '\\f':	\\
        case 0x85:case 0xa0:
-"
+EOM
 
 echo '#define SPACECASE16	SPACECASE8 \'
 sed -n -e '
-- 
1.7.10.4

  • bash/dash Arne Goedeke
    • Re: bash/dash Chris Angelico
      • Re: bash/... Arne Goedeke
        • Re: b... Chris Angelico
          • R... Arne Goedeke
            • ... Chris Angelico
              • ... Per Hedbor () @ Pike (-) developers forum
                • ... Henrik Grubbström (Lysator) @ Pike (-) developers forum
          • R... Stephen R. van den Berg
            • ... Chris Angelico
              • ... Stephen R. van den Berg

Reply via email to