From 9cc8ff920a1fa88d05f9581977de6f483e980e94 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Wed, 6 Jun 2018 19:35:04 +0700 Subject: [PATCH] Special case t.items = [Text _] and t.items = [] Signed-off-by: Rudi Grinberg --- src/string_with_vars.ml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/string_with_vars.ml b/src/string_with_vars.ml index 28aa90dc..0ed7a62c 100644 --- a/src/string_with_vars.ml +++ b/src/string_with_vars.ml @@ -170,6 +170,8 @@ let partial_expand t ~mode ~dir ~f = end in match t.items with + | [] -> Partial.Expanded (Mode.string mode "") + | [Text s] -> Expanded (Mode.string mode s) | [Var (syntax, v)] when not t.quoted -> (* Unquoted single var *) begin match f syntax t.loc v with