SLING-9227 - clarify escaped backslashes in quoted strings
diff --git a/src/main/javacc/RepoInitGrammar.jjt b/src/main/javacc/RepoInitGrammar.jjt
index a6bbb73..0e94eac 100644
--- a/src/main/javacc/RepoInitGrammar.jjt
+++ b/src/main/javacc/RepoInitGrammar.jjt
@@ -662,7 +662,10 @@
     ( str = <QUOTED> )
     {
         // Remove escaping backslash for double quotes
-        return str.image.replaceAll("\\\\\"", "\"");
+        return str.image
+            .replaceAll("\\\\\"", "\"")
+            .replaceAll("\\\\\\\\", "\\\\")
+        ;
     }
 }
 
diff --git a/src/test/java/org/apache/sling/repoinit/parser/test/ParsingErrorsTest.java b/src/test/java/org/apache/sling/repoinit/parser/test/ParsingErrorsTest.java
index c5c5628..b7f5fe6 100644
--- a/src/test/java/org/apache/sling/repoinit/parser/test/ParsingErrorsTest.java
+++ b/src/test/java/org/apache/sling/repoinit/parser/test/ParsingErrorsTest.java
@@ -76,6 +76,7 @@
             add(new Object[] { "disable service user foo \"missing colon\"", ParseException.class });
             add(new Object[] { "disable service user foo : missing start quote\"", ParseException.class });
             add(new Object[] { "disable service user foo : \"missing end quote", ParseException.class });
+            add(new Object[] { "disable service user foo: \"Unescaped quoted single backslash \"\\\" fails", ParseException.class });
 
             // SLING-7066 default mixin is not supported
             add(new Object[] { "create path (sling:Folder mixin mix:A) /var/foo", ParseException.class });
diff --git a/src/test/resources/testcases/test-61-output.txt b/src/test/resources/testcases/test-61-output.txt
index 4375388..ac995c0 100644
--- a/src/test/resources/testcases/test-61-output.txt
+++ b/src/test/resources/testcases/test-61-output.txt
@@ -1,2 +1,5 @@
 DisableServiceUser svcA : This message explains why it's disabled.  Whitespace   is  preserved.
-DisableServiceUser svcB : Testing escaped double "quote" in this string.
\ No newline at end of file
+DisableServiceUser svcB : Testing escaped double "quote" in this string.
+DisableServiceUser svcC : Testing escaped backslash \ in this string.
+DisableServiceUser svcD : Testing quoted escaped backslash "\" in this string.
+DisableServiceUser svcE : Testing unescaped single backslash \ in this string.
\ No newline at end of file
diff --git a/src/test/resources/testcases/test-61.txt b/src/test/resources/testcases/test-61.txt
index 72b2324..24284ce 100644
--- a/src/test/resources/testcases/test-61.txt
+++ b/src/test/resources/testcases/test-61.txt
@@ -1,3 +1,6 @@
 # Test "disable service user" statements
 disable service user svcA : "This message explains why it's disabled.  Whitespace   is  preserved."
-disable service user svcB : "Testing escaped double \"quote\" in this string."
\ No newline at end of file
+disable service user svcB : "Testing escaped double \"quote\" in this string."
+disable service user svcC : "Testing escaped backslash \\ in this string."
+disable service user svcD : "Testing quoted escaped backslash \"\\\" in this string."
+disable service user svcE : "Testing unescaped single backslash \ in this string."
\ No newline at end of file