2008-08-13 Eric Gillespie <epg@pretzelnet.org>
+ * uip/pick.c: Print matching messages immediately, instead of
+ waiting until the very end to print anything.
+
+2008-08-13 Eric Gillespie <epg@pretzelnet.org>
+
* uip/Makefile.in, uip/popi.c: Remove popi.c, which has been dead
since PatchSet 257 (2000/06/12 11:07:34 UTC).
*
* $Id$
*
- * This code is Copyright (c) 2002, by the authors of nmh. See the
+ * This code is Copyright (c) 2002, 2008, by the authors of nmh. See the
* COPYRIGHT file in the root directory of the nmh distribution for
* complete copyright information.
*/
lo = mp->lowsel;
hi = mp->hghsel;
+ /* If printing message numbers to standard out, force line buffering on.
+ */
+ if (listsw)
+ setvbuf (stdout, NULL, _IOLBF, 0);
+
/*
* Scan through all the SELECTED messages and check for a
* match. If the message does not match, then unselect it.
lo = msgnum;
if (msgnum > hi)
hi = msgnum;
+
+ if (listsw)
+ printf ("%s\n", m_name (msgnum));
} else {
/* if it doesn't match, then unselect it */
unset_selected (mp, msgnum);
done (1);
/*
- * Print the name of all the matches
+ * Print total matched if not printing each matched message number.
*/
- if (listsw) {
- for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++)
- if (is_selected (mp, msgnum))
- printf ("%s\n", m_name (msgnum));
- } else {
+ if (!listsw) {
printf ("%d hit%s\n", mp->numsel, mp->numsel == 1 ? "" : "s");
}