From 282d237bc4033d4ff4e0ead34347721f8b10a224 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Tue, 1 Nov 2011 20:05:07 +0100 Subject: [PATCH] com_ls: Print an error message if no file matched. 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. --- aft.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aft.c b/aft.c index 6ac6a3a7..f6d0c4b3 100644 --- a/aft.c +++ b/aft.c @@ -1364,8 +1364,11 @@ static void com_ls_callback(int fd, const struct osl_object *query) 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; -- 2.39.5