Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/cron/dist store lastch to an int so that EOF is...



details:   https://anonhg.NetBSD.org/src/rev/3a1d9473aa38
branches:  trunk
changeset: 332079:3a1d9473aa38
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Sep 06 12:18:49 2014 +0000

description:
store lastch to an int so that EOF is handled properly.

diffstat:

 external/bsd/cron/dist/crontab.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (46 lines):

diff -r 926aa3dd5d02 -r 3a1d9473aa38 external/bsd/cron/dist/crontab.c
--- a/external/bsd/cron/dist/crontab.c  Sat Sep 06 12:12:32 2014 +0000
+++ b/external/bsd/cron/dist/crontab.c  Sat Sep 06 12:18:49 2014 +0000
@@ -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 @@
  */
 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 @@
         */
        (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 @@
        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;



Home | Main Index | Thread Index | Old Index