<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>high
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Skipping backwards with matches is subtly broken"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=63250">63250</a>
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Skipping backwards with matches is subtly broken
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>systemd-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>marius.vollmer@redhat.com
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>general
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>systemd
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=77577" name="attach_77577" title="Fix typo.">attachment 77577</a> <a href="attachment.cgi?id=77577&action=edit" title="Fix typo.">[details]</a></span> <a href='page.cgi?id=splinter.html&bug=63250&attachment=77577'>[review]</a>
Fix typo.

I think it's just a typo, check the attached patch.

Sometimes, skipping backwards with a match that yields the empty set will not
return 0, but will successfully skip the requested number of items.  The next
call to sd_journal_next will then correctly return 0.

To reproduce, find two matches that are independently non-empty, but whose
intersection is empty, and then use them with "journalctl -n10" or similar.

For example:

  # journalctl PRIORITY=2
  <some output>
  # journalctl _PID=1
  <some other output>
  # journalctl PRIORITY=2 _PID=1
  <empty>

But

  # journalctl -n10 PRIORITY=2 _PID=1
  <one entry>

You might need to swap the match expressions:

  # journalctl -n10 _PID=1 PRIORITY=2

As mentioned, I think this is just a typo in next_for_match for the
DIRECTION_UP case.  The attached patch seems to fix all incorrect behavior that
I could find.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>