diff options
author | Dmitry Lomov <dslomov@google.com> | 2016-02-17 19:31:28 +0000 |
---|---|---|
committer | Kristina Chodorow <kchodorow@google.com> | 2016-02-17 19:41:18 +0000 |
commit | cbbbf2e461396d3817a00c4bd4d26b9b43b68ce3 (patch) | |
tree | ead3caabc258c804d822ad7d268971e12b6b9d0c | |
parent | fbf3cd2e9e059e8a5cf89bfceba11b2f09bb74d2 (diff) |
Add escapes to quotation marks in Java version detection genrule.
Quotation mark character is significant for Win32's CreateProcess.
It should always be properly escaped when occuring inside arguments.
We might devise a common solution in GenRule for that, but for now
this change fixes the only genrule we use that runs into this issue.
Needed for #276.
--
MOS_MIGRATED_REVID=114881441
-rw-r--r-- | src/BUILD | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -57,7 +57,7 @@ genrule( outs = ["java.version"], cmd = """ VERSION_LINE=$$(cat $< | grep target_version); - JAVA_VERSION=$$(echo $${VERSION_LINE} | sed 's/.*value="\\([^"]\\)".*/\\1/'); + JAVA_VERSION=$$(echo $${VERSION_LINE} | sed 's/.*value=\\"\\([^\\"]\\)\\".*/\\1/'); if [ -z "$${JAVA_VERSION}" ]; then echo "1.8" >$@ # Java 8 is the default elif [[ "$${JAVA_VERSION}" =~ ^[0-9]+$$ ]]; then |