From: Andre Noll Date: Tue, 1 Nov 2011 19:05:07 +0000 (+0100) Subject: com_ls: Print an error message if no file matched. X-Git-Tag: v0.4.9~3^2~1 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=282d237bc4033d4ff4e0ead34347721f8b10a224;hp=6bfdc5bf94294ee8ec19c530d77ea4a0fb4e8618 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. --- 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;