Checks if exclude file is empty before creating the regular expressions.
authorCamila San <hello@camila.codes>
Mon, 30 Sep 2019 18:33:51 +0000 (20:33 +0200)
committerCamila San <hello@camila.codes>
Mon, 30 Sep 2019 18:38:56 +0000 (20:38 +0200)
The default file created by the application it is not empty.

Signed-off-by: Camila San <hello@camila.codes>
src/csync/csync_exclude.cpp

index 32b88616ced8de00672b67729a89e6b331c8dbdd..1bb66b15d303c209c083c584ba3246817493abaf 100644 (file)
@@ -322,7 +322,11 @@ bool ExcludedFiles::loadExcludeFile(const QByteArray & basePath, const QString &
         csync_exclude_expand_escapes(line);
         _allExcludes[basePath].append(line);
     }
-    prepare(basePath);
+
+    // nothing to prepare if the user decided to not exclude anything
+    if(_allExcludes.size())
+        prepare(basePath);
+
     return true;
 }