Commit 0e67c1ce authored by Jean-Francois Dockes's avatar Jean-Francois Dockes
Browse files

bad test of appartenance of search dir would always fail for subdirs

parent afb112a6
......@@ -252,18 +252,19 @@ def recoll_initsearch(q):
else:
confdirs = []
for d,conf in config['dirs'].items():
if os.path.commonprefix([os.path.basename(d),q['dir']]) == q['dir']:
tdbasename = os.path.basename(d)
if os.path.commonprefix([tdbasename, q['dir']]) == tdbasename:
confdirs.append(conf)
if len(confdirs) == 0:
# should not happen, using non-existing q['dir']?
bottle.abort(400, 'no matching database for topdir ' + q['dir'])
bottle.abort(400, 'no matching database for search directory ' + q['dir'])
elif len(confdirs) == 1:
# only one config (most common situation)
confdir = confdirs[0]
else:
# more than one config with matching topdir, use 'm all
confdir = confdirs[0]
dbs.extend(map(get_dbdir,confdirs[1:]))
dbs.extend(map(get_dbdir, confdirs[1:]))
if config['extradbs']:
dbs.extend(config['extradbs'])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment