diff --git a/usr.sbin/cron/crontab.c b/usr.sbin/cron/crontab.c index 3f8e50d1f143..78f27e8d12ff 100644 --- a/usr.sbin/cron/crontab.c +++ b/usr.sbin/cron/crontab.c @@ -1,4 +1,4 @@ -/* $NetBSD: crontab.c,v 1.23 2004/10/30 17:14:36 dsl Exp $ */ +/* $NetBSD: crontab.c,v 1.24 2004/12/22 00:49:14 christos Exp $ */ /* Copyright 1988,1990,1993,1994 by Paul Vixie * All rights reserved @@ -22,7 +22,7 @@ #if 0 static char rcsid[] = "Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp"; #else -__RCSID("$NetBSD: crontab.c,v 1.23 2004/10/30 17:14:36 dsl Exp $"); +__RCSID("$NetBSD: crontab.c,v 1.24 2004/12/22 00:49:14 christos Exp $"); #endif #endif @@ -271,16 +271,16 @@ skip_header(pch, f) ch = get_char(f); if (EOF == ch) break; - if ('#' != ch) { - putc(ch, NewCrontab); + if ('#' != ch) break; - } while (EOF != (ch = get_char(f))) if (ch == '\n') break; if (EOF == ch) break; } + if (ch == '\n') + ch = get_char(f); *pch = ch; } @@ -306,7 +306,7 @@ list_cmd() { */ Set_LineNum(1) skip_header(&ch, f); - while (EOF != (ch = get_char(f))) + for (; EOF != ch; ch = get_char(f)) putchar(ch); fclose(f); } @@ -393,9 +393,8 @@ edit_cmd() { /* copy the rest of the crontab (if any) to the temp file. */ - if (EOF != ch) - while (EOF != (ch = get_char(f))) - putc(ch, NewCrontab); + for (; EOF != ch; ch = get_char(f)) + putc(ch, NewCrontab); fclose(f); if (fflush(NewCrontab) < OK) { perror(Filename); @@ -589,7 +588,7 @@ replace_cmd() { fprintf(tmp, "# DO NOT EDIT THIS FILE - edit the master and reinstall.\n"); fprintf(tmp, "# (%s installed on %-24.24s)\n", Filename, ctime(&now)); fprintf(tmp, "# (Cron version -- %s)\n", - "$NetBSD: crontab.c,v 1.23 2004/10/30 17:14:36 dsl Exp $"); + "$NetBSD: crontab.c,v 1.24 2004/12/22 00:49:14 christos Exp $"); /* copy the crontab to the tmp */