]> git.tuebingen.mpg.de Git - paraslash.git/commit
catblob: Fix "no matches" message.
authorAndre Noll <maan@systemlinux.org>
Mon, 26 Sep 2011 20:51:48 +0000 (22:51 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 6 Nov 2011 11:29:13 +0000 (12:29 +0100)
commit6bfdc5bf94294ee8ec19c530d77ea4a0fb4e8618
tree565a7c12d2400d5d655cd7ad268e66f98af19594
parentb326b33f0afef8f68623d30fff936d615ce43bc7
catblob: Fix "no matches" message.

The catblob commands are supposed to print this message only if none
of the given patterns matches any blob in the database.  However, in
case all of the matching blobs are empty, we do print the message.

The problem is that the match count is not being increased due
to cat_blob() returning negative for empty blobs. This count is
computed in action_if_pattern_matches() which calls cat_blob() as
its action handler which in turn calls osl_open_disk_object(). But
this function returns -E_OSL_EMPTY for empty blobs, and cat_blob()
just passes through this value.

This patch changes cat_blob() so that it explicitly checks for
-E_OSL_EMPTY and returns zero in this case so that the match counter
will be increased.
blob.c