aboutsummaryrefslogtreecommitdiffstats
path: root/main/augeas/0005-Shellvars-allow-quotes-in-loop-conditions.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/augeas/0005-Shellvars-allow-quotes-in-loop-conditions.patch')
-rw-r--r--main/augeas/0005-Shellvars-allow-quotes-in-loop-conditions.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/main/augeas/0005-Shellvars-allow-quotes-in-loop-conditions.patch b/main/augeas/0005-Shellvars-allow-quotes-in-loop-conditions.patch
new file mode 100644
index 0000000000..d4dcdb9a51
--- /dev/null
+++ b/main/augeas/0005-Shellvars-allow-quotes-in-loop-conditions.patch
@@ -0,0 +1,54 @@
+From 1e842317de344335cf6f0b947156b401df1daae4 Mon Sep 17 00:00:00 2001
+From: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>
+Date: Mon, 8 Dec 2014 14:28:16 +0200
+Subject: [PATCH 05/10] Shellvars: allow quotes in loop conditions
+
+---
+ lenses/shellvars.aug | 8 +-------
+ lenses/tests/test_shellvars.aug | 4 ++++
+ 2 files changed, 5 insertions(+), 7 deletions(-)
+
+diff --git a/lenses/shellvars.aug b/lenses/shellvars.aug
+index e318328..3671186 100644
+--- a/lenses/shellvars.aug
++++ b/lenses/shellvars.aug
+@@ -45,12 +45,6 @@ module Shellvars =
+ let anyquot = (char|dquot|squot|dollar_assign|dollar_arithm)+ | bquot | dbquot
+ let sto_to_semicol = store (anyquot . (Rx.space . anyquot)*)
+
+- let sto_to_semicol_quot =
+- let no_semicol_re = /[^"'#;\n]/
+- in let no_semicol_spc_re = /[^"'#; \t\n]/
+- in let multi_chars = no_semicol_spc_re . (no_semicol_re|anyquot)+ . no_semicol_spc_re
+- in store (no_semicol_spc_re | multi_chars)
+-
+ (* Array values of the form '(val1 val2 val3)'. We do not handle empty *)
+ (* arrays here because of typechecking headaches. Instead, they are *)
+ (* treated as a simple value *)
+@@ -108,7 +102,7 @@ module Shellvars =
+ let generic_cond_start (start_kw:string) (lbl:string)
+ (then_kw:string) (contents:lens) =
+ keyword_label start_kw lbl . Sep.space
+- . sto_to_semicol_quot . semicol_eol
++ . sto_to_semicol . semicol_eol
+ . keyword then_kw . eol
+ . contents
+
+diff --git a/lenses/tests/test_shellvars.aug b/lenses/tests/test_shellvars.aug
+index 90e529b..8d8f34d 100644
+--- a/lenses/tests/test_shellvars.aug
++++ b/lenses/tests/test_shellvars.aug
+@@ -502,6 +502,10 @@ fi\n" =
+ test Shellvars.lns get "for x in foo \\\nbar\\\nbaz; do y=$x; done\n" =
+ { "@for" = "x in foo \\\nbar\\\nbaz" { "y" = "$x" } }
+
++ (* Allow quotes in loop conditions *)
++ test Shellvars.lns get "for x in \"$@\"; do y=$x; done\n" =
++ { "@for" = "x in \"$@\"" { "y" = "$x" } }
++
+ (* Local Variables: *)
+ (* mode: caml *)
+ (* End: *)
+--
+1.8.3.1
+