In case at least one pattern was given and no matches were found,
the ls command returned with no output at all. This makes it print a
"no matches" error message instead.
prepare_ls_row));
if (ret < 0)
goto out;
- if (!opts->num_matching_paths)
+ if (opts->num_matching_paths == 0) {
+ if (opts->num_patterns > 0)
+ para_printf(&b, "no matches\n");
goto out;
+ }
ret = sort_matching_paths(opts);
if (ret < 0)
goto out;