nmh-workers
[Top] [All Lists]

[Nmh-workers] unused m_getfld() states

2013-01-06 20:57:57
Something to consider when everyone (:-) is reviewing the
m_getfld() update:  it has two states, FLDEOF and BODYEOF,
that it never uses.  And based on the old MH RCS file, it
has never used them.  So there's an opportunity to clean up
callers a bit by removing their handling of those states.

Here are all of the states:

 #define FMTERR  (-3)           /* Message Format error             */
 #define FLD      0             /* Field returned                   */
 #define FLDPLUS  1             /* Field returned with more to come */
 #define FLDEOF   2  [UNUSED!]  /* Field returned ending at eom     */
 #define BODY     3             /* Body  returned with more to come */
 #define BODYEOF  4  [UNUSED!]  /* Body  returned ending at eom     */
 #define FILEEOF  5             /* Reached end of input file        */

Maybe we could replace some current uses of FILEEOF with
FLDEOF/BODYEOF, but we've gotten this far without them.  And
then the calling code would have to be examined because
there's no telling if it would do the right thing.

Back to the m_getfld() review.  To quickly see the critical
changes to m_getfld.c:

  git diff -w --color=auto d3d007e8 6195e9e4 sbr/m_getfld.c

You don't even need to switch to the branch.

Thanks,
David

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>
  • [Nmh-workers] unused m_getfld() states, David Levine <=