aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Dmitry Lomov <dslomov@google.com>2016-02-17 19:31:28 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2016-02-17 19:41:18 +0000
commitcbbbf2e461396d3817a00c4bd4d26b9b43b68ce3 (patch)
treeead3caabc258c804d822ad7d268971e12b6b9d0c
parentfbf3cd2e9e059e8a5cf89bfceba11b2f09bb74d2 (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/BUILD2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/BUILD b/src/BUILD
index 17c8f2e1b5..9723aa8042 100644
--- a/src/BUILD
+++ b/src/BUILD
@@ -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