Module Name: src
Committed By: christos
Date: Sat Sep 6 12:18:49 UTC 2014
Modified Files:
src/external/bsd/cron/dist: crontab.c
Log Message:
store lastch to an int so that EOF is handled properly.
To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/cron/dist/crontab.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/bsd/cron/dist/crontab.c
diff -u src/external/bsd/cron/dist/crontab.c:1.9 src/external/bsd/cron/dist/crontab.c:1.10
--- src/external/bsd/cron/dist/crontab.c:1.9 Fri Sep 5 17:32:37 2014
+++ src/external/bsd/cron/dist/crontab.c Sat Sep 6 08:18:49 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: crontab.c,v 1.9 2014/09/05 21:32:37 christos Exp $ */
+/* $NetBSD: crontab.c,v 1.10 2014/09/06 12:18:49 christos Exp $ */
/* Copyright 1988,1990,1993,1994 by Paul Vixie
* All rights reserved
@@ -25,7 +25,7 @@
#if 0
static char rcsid[] = "Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp";
#else
-__RCSID("$NetBSD: crontab.c,v 1.9 2014/09/05 21:32:37 christos Exp $");
+__RCSID("$NetBSD: crontab.c,v 1.10 2014/09/06 12:18:49 christos Exp $");
#endif
#endif
@@ -560,7 +560,8 @@ edit_cmd(void) {
*/
static int
replace_cmd(void) {
- char n[MAX_FNAME], n2[MAX_FNAME], envstr[MAX_ENVSTR], lastch;
+ char n[MAX_FNAME], n2[MAX_FNAME], envstr[MAX_ENVSTR];
+ int lastch;
FILE *tmp, *fmaxtabsize;
int ch, eof, fd;
int error = 0;
@@ -638,7 +639,7 @@ replace_cmd(void) {
*/
(void)fprintf(tmp, "# DO NOT EDIT THIS FILE - edit the master and reinstall.\n");
(void)fprintf(tmp, "# (%s installed on %-24.24s)\n", Filename, ctime(&now));
- (void)fprintf(tmp, "# (Cron version %s -- %s)\n", CRON_VERSION, "$NetBSD: crontab.c,v 1.9 2014/09/05 21:32:37 christos Exp $");
+ (void)fprintf(tmp, "# (Cron version %s -- %s)\n", CRON_VERSION, "$NetBSD: crontab.c,v 1.10 2014/09/06 12:18:49 christos Exp $");
/* copy the crontab to the tmp
*/
@@ -648,7 +649,7 @@ replace_cmd(void) {
while (EOF != (ch = get_char(NewCrontab)))
(void)putc(lastch = (char)ch, tmp);
- if (lastch != (char)EOF && lastch != '\n') {
+ if (lastch != EOF && lastch != '\n') {
warnx("missing trailing newline in `%s'", Filename);
error = -1;
goto done;