mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Remove the 'DO NOT EDIT THIS FILE' crud that we spit out with 'crontab -l'.
Otherwise, "crontab -l > file; vi file; crontab file" adds an extra set of "DO NOT EDIT" markers each and every time which is a bit silly.
This commit is contained in:
parent
584096c53e
commit
8966f5046e
1 changed files with 19 additions and 1 deletions
|
|
@ -226,7 +226,7 @@ static void
|
|||
list_cmd() {
|
||||
char n[MAX_FNAME];
|
||||
FILE *f;
|
||||
int ch;
|
||||
int ch, x;
|
||||
|
||||
log_it(RealUser, Pid, "LIST", User);
|
||||
(void) sprintf(n, CRON_TAB(User));
|
||||
|
|
@ -240,6 +240,24 @@ list_cmd() {
|
|||
/* file is open. copy to stdout, close.
|
||||
*/
|
||||
Set_LineNum(1)
|
||||
|
||||
/* ignore the top few comments since we probably put them there.
|
||||
*/
|
||||
for (x = 0; x < NHEADER_LINES; x++) {
|
||||
ch = get_char(f);
|
||||
if (EOF == ch)
|
||||
break;
|
||||
if ('#' != ch) {
|
||||
putc(ch, NewCrontab);
|
||||
break;
|
||||
}
|
||||
while (EOF != (ch = get_char(f)))
|
||||
if (ch == '\n')
|
||||
break;
|
||||
if (EOF == ch)
|
||||
break;
|
||||
}
|
||||
|
||||
while (EOF != (ch = get_char(f)))
|
||||
putchar(ch);
|
||||
fclose(f);
|
||||
|
|
|
|||
Loading…
Reference in a new issue