summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/tagcache.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c
index d7a377e7e2..8448c02db1 100644
--- a/apps/tagcache.c
+++ b/apps/tagcache.c
@@ -4091,13 +4091,30 @@ static bool check_deleted_files(void)
4091 return true; 4091 return true;
4092} 4092}
4093 4093
4094
4095/* Note that this function must not be inlined, otherwise the whole point
4096 * of having the code in a separate function is lost.
4097 */
4098static void __attribute__ ((noinline)) check_ignore(const char *dirname,
4099 int *ignore, int *unignore)
4100{
4101 char newpath[MAX_PATH];
4102
4103 /* check for a database.ignore file */
4104 snprintf(newpath, MAX_PATH, "%s/database.ignore", dirname);
4105 *ignore = file_exists(newpath);
4106 /* check for a database.unignore file */
4107 snprintf(newpath, MAX_PATH, "%s/database.unignore", dirname);
4108 *unignore = file_exists(newpath);
4109}
4110
4111
4094static bool check_dir(const char *dirname, int add_files) 4112static bool check_dir(const char *dirname, int add_files)
4095{ 4113{
4096 DIR *dir; 4114 DIR *dir;
4097 int len; 4115 int len;
4098 int success = false; 4116 int success = false;
4099 int ignore, unignore; 4117 int ignore, unignore;
4100 char newpath[MAX_PATH];
4101 4118
4102 dir = opendir(dirname); 4119 dir = opendir(dirname);
4103 if (!dir) 4120 if (!dir)
@@ -4106,12 +4123,8 @@ static bool check_dir(const char *dirname, int add_files)
4106 return false; 4123 return false;
4107 } 4124 }
4108 4125
4109 /* check for a database.ignore file */ 4126 /* check for a database.ignore and database.unignore */
4110 snprintf(newpath, MAX_PATH, "%s/database.ignore", dirname); 4127 check_ignore(dirname, &ignore, &unignore);
4111 ignore = file_exists(newpath);
4112 /* check for a database.unignore file */
4113 snprintf(newpath, MAX_PATH, "%s/database.unignore", dirname);
4114 unignore = file_exists(newpath);
4115 4128
4116 /* don't do anything if both ignore and unignore are there */ 4129 /* don't do anything if both ignore and unignore are there */
4117 if (ignore != unignore) 4130 if (ignore != unignore)