From: Ralph Corderoy Date: Sun, 30 Oct 2016 15:04:38 +0000 (+0000) Subject: Remove sbr/peekc.c containing unused peekc(). X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/f7045eaebc7cd9a7b2d4a29c355a153887b9921c?hp=87e0228a43ba73eac409f2f0d7f75f3b6148adfc Remove sbr/peekc.c containing unused peekc(). gcov showed it wasn't getting any; we've all been there. It didn't check for EOF, nor that the ungetc(3) succeeded. --- diff --git a/Makefile.am b/Makefile.am index 8aecc8b2..4b6e4f5f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -602,7 +602,7 @@ sbr_libmh_a_SOURCES = sbr/addrsbr.c sbr/ambigsw.c sbr/atooi.c sbr/arglist.c \ sbr/makedir.c sbr/md5.c sbr/message_id.c \ sbr/mime_type.c sbr/mts.c sbr/netsec.c \ sbr/norm_charmap.c sbr/path.c \ - sbr/peekc.c sbr/pidwait.c sbr/pidstatus.c \ + sbr/pidwait.c sbr/pidstatus.c \ sbr/print_help.c sbr/print_sw.c sbr/print_version.c \ sbr/push.c sbr/putenv.c sbr/refile.c sbr/remdir.c \ sbr/r1bindex.c sbr/readconfig.c sbr/ruserpass.c \ diff --git a/h/prototypes.h b/h/prototypes.h index a17d12f9..6c4fdcfb 100644 --- a/h/prototypes.h +++ b/h/prototypes.h @@ -312,7 +312,6 @@ void nmh_clear_screen(void); char *nmh_getpass(const char *); char *new_fs (char *, char *, char *); char *path(char *, int); -int peekc(FILE *ib); int pidwait (pid_t, int); int pidstatus (int, FILE *, char *); char *pluspath(char *); diff --git a/sbr/peekc.c b/sbr/peekc.c deleted file mode 100644 index 3bfe42a3..00000000 --- a/sbr/peekc.c +++ /dev/null @@ -1,21 +0,0 @@ - -/* - * 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 - - -int -peekc(FILE *fp) -{ - int c; - - c = getc(fp); - ungetc(c, fp); - return c; -}