From 502e2e0eed58194c63709640de699b407b77437e Mon Sep 17 00:00:00 2001 From: David Reiss Date: Fri, 5 Jul 2013 10:27:18 -0700 Subject: [PATCH 1/3] Don't treat exclude lines with embedded "+" characters as inclusions Previously, this code prevented any file name with a "+" character from being excluded. --- lsyncd.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lsyncd.lua b/lsyncd.lua index a268c58..16d05fb 100644 --- a/lsyncd.lua +++ b/lsyncd.lua @@ -1384,7 +1384,7 @@ local Excludes = ( function( ) -- lsyncd 2.0 does not support includes - if not string.match(line, '%s*+') then + if not string.match(line, '^%s*+') then local p = string.match( line, '%s*-?%s*(.*)' ) From 716b88909a81868ddb07d0519e148822a0d3111c Mon Sep 17 00:00:00 2001 From: David Reiss Date: Fri, 5 Jul 2013 10:42:50 -0700 Subject: [PATCH 2/3] Escape + in pattern for extra safety The old version worked, but it seems like an accident that a "+" after a "*" is treated as a literal "+" and not a repetition. --- lsyncd.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lsyncd.lua b/lsyncd.lua index 16d05fb..e3197fc 100644 --- a/lsyncd.lua +++ b/lsyncd.lua @@ -1384,7 +1384,7 @@ local Excludes = ( function( ) -- lsyncd 2.0 does not support includes - if not string.match(line, '^%s*+') then + if not string.match(line, '^%s*%+') then local p = string.match( line, '%s*-?%s*(.*)' ) From d772fcba0fb21abca796b4c2f67b102dd09a14ed Mon Sep 17 00:00:00 2001 From: David Reiss Date: Fri, 5 Jul 2013 10:44:52 -0700 Subject: [PATCH 3/3] Ignore blank lines and rsync comments in excludes file --- lsyncd.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lsyncd.lua b/lsyncd.lua index e3197fc..d92b4e8 100644 --- a/lsyncd.lua +++ b/lsyncd.lua @@ -1384,7 +1384,9 @@ local Excludes = ( function( ) -- lsyncd 2.0 does not support includes - if not string.match(line, '^%s*%+') then + if not string.match(line, '^%s*%+') and + not string.match(line, '^%s*#') and + not string.match(line, '^%s*$') then local p = string.match( line, '%s*-?%s*(.*)' )