From 9b23eb2d23ee695968d8b96139a30b8f9fe7080d Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 21 Jun 2015 15:49:17 -0400 Subject: [PATCH] CLI2: Bug parsing attribute modfiiers - Consider 'project.is:home' and 'project:home.garden'. The colon ':' and the dot '.' switch places and change the meaning. This was not caught by the paser. - Removed commented call that is now merged. --- src/CLI2.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/CLI2.cpp b/src/CLI2.cpp index d82f3c0a6..cfaa13323 100644 --- a/src/CLI2.cpp +++ b/src/CLI2.cpp @@ -519,10 +519,7 @@ void CLI2::prepareFilter (bool applyContext) desugarFilterPlainArgs (); desugarFilterTags (); findStrayModifications (); -/* desugarFilterAttributes (); - desugarFilterAttributeModifiers (); -*/ desugarFilterPatterns (); /* insertJunctions (); // Deliberately after all desugar calls. @@ -923,7 +920,10 @@ void CLI2::desugarFilterAttributes () std::string mod = ""; std::string value = ""; - if (dot != std::string::npos) + // If the dot appears after the colon, then it is part of the value, and + // should be ignored. + if (dot != std::string::npos && + dot < colon) { name = raw.substr (0, dot); mod = raw.substr (dot + 1, colon - dot - 1);