char *nmh_getpass(const char *);
char *norm_charmap(char *);
char *new_fs(char *, char *);
-int peekc(FILE *ib);
int pidwait(pid_t, int);
int pidstatus(int, FILE *, char *);
void print_help(char *, struct swit *, int);
m_convert.c m_draft.c m_getfld.c m_gmprot.c \
m_name.c \
makedir.c mts.c norm_charmap.c \
- path.c peekc.c pidwait.c pidstatus.c \
+ path.c pidwait.c pidstatus.c \
print_help.c print_sw.c print_version.c \
putenv.c refile.c mhbasename.c \
readconfig.c ruserpass.c seq_add.c seq_bits.c \
+++ /dev/null
-/*
-** peekc.c -- peek at the next character in a stream
-**
-** This code is Copyright (c) 2002, by the authors of nmh. See the
-** COPYRIGHT file in the root directory of the nmh distribution for
-** complete copyright information.
-*/
-
-#include <h/mh.h>
-
-
-int
-peekc(FILE *fp)
-{
- register int c;
-
- c = getc(fp);
- ungetc(c, fp);
- return c;
-}
for (c = 0; fgets(buffer, sizeof(buffer), in); c = buffer[0]) {
if (strncmp(buffer, delim3, ld3) == 0
- && (msgp == 1 || c == '\n')
- && ((cc = peekc(in)) == '\n' ||
- cc == EOF))
- break;
- else
+ && (msgp == 1 || c == '\n')) {
+ cc = getc(in);
+ ungetc(cc, in);
+ if (cc == '\n' || cc == EOF) {
+ break;
+ }
+ } else
pos += (long) strlen(buffer);
}