diff --git a/ChangeLog b/ChangeLog index 9b7de02..26a7da0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ ????-??-??: 2.2.2 fix: checkgauge 'insist' + fix: no partial path exlusion tests 2017-01-05: 2.2.1 enhancement: now always using filter lists with rysnc diff --git a/lsyncd.lua b/lsyncd.lua index 13da7ac..2f01aa0 100644 --- a/lsyncd.lua +++ b/lsyncd.lua @@ -1852,13 +1852,13 @@ local Excludes = ( function( ) p = string.gsub( p, '%[%^/%]%*%[%^/%]%*', '.*' ) p = string.gsub( p, '^/', '^/' ) --- if p:sub( 1, 2 ) ~= '^/' --- then --- -- if does not begin with '^/' --- -- then all matches should begin with '/'. --- p = '/' .. p; --- end --- + if p:sub( 1, 2 ) ~= '^/' + then + -- if does not begin with '^/' + -- then all matches should begin with '/'. + p = '/' .. p; + end + log( 'Exclude', 'toLuaPattern "', @@ -1971,6 +1971,11 @@ local Excludes = ( function( ) self, -- self path -- the path to test ) + if path:byte( 1 ) ~= 47 + then + error( 'Paths for exlusion tests must start with \'/\'' ) + end + for _, p in pairs( self.list ) do if p:byte( -1 ) == 36