finddir({name}[, {path}[, {count}]]) *finddir()*
- Find directory {name} in {path}. Returns the path of the
- first found match. When the found directory is below the
- current directory a relative path is returned. Otherwise a
- full path is returned.
+ Find directory {name} in {path}. Supports both downwards and
+ upwards recursive directory searches. See |file-searching|
+ for the syntax of {path}.
+ Returns the path of the first found match. When the found
+ directory is below the current directory a relative path is
+ returned. Otherwise a full path is returned.
If {path} is omitted or empty then 'path' is used.
If the optional {count} is given, find {count}'s occurrence of
{name} in {path} instead of the first one.
vim_free(fresult);
fresult = find_file_in_path_option(first ? fname : NULL,
first ? (int)STRLEN(fname) : 0,
- 0, first, path, dir, NULL,
+ 0, first, path, dir, curbuf->b_ffname,
dir ? (char_u *)"" : curbuf->b_p_sua);
first = FALSE;