ALT Linux Bugzilla
– Attachment 2596 Details for
Bug 14751
Лишняя информация в выводе crontab -l
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
Предлагаемый патч.
14751.patch (text/plain), 1.73 KB, created by
Slava Semushin
on 2008-04-29 10:17:03 MSD
(
hide
)
Description:
Предлагаемый патч.
Filename:
MIME Type:
Creator:
Slava Semushin
Created:
2008-04-29 10:17:03 MSD
Size:
1.73 KB
patch
obsolete
>diff --git a/vixie-cron/usr.sbin/cron/crontab.c b/vixie-cron/usr.sbin/cron/crontab.c >index 40638fc..c1a3272 100644 >--- a/vixie-cron/usr.sbin/cron/crontab.c >+++ b/vixie-cron/usr.sbin/cron/crontab.c >@@ -56,7 +56,9 @@ static void list_cmd(void), > check_error(const char *), > parse_args(int c, char *v[]), > die(int); >-static int replace_cmd(void); >+static int replace_cmd(void), >+ ignore_comments(FILE *); >+ > > static void > usage(const char *msg) { >@@ -247,6 +249,11 @@ list_cmd(void) { > /* file is open. copy to stdout, close. > */ > Set_LineNum(1) >+ >+ /* ignore the top few comments since we probably put them there. >+ */ >+ ch = ignore_comments(f); >+ > while (EOF != (ch = get_char(f))) > putchar(ch); > fclose(f); >@@ -281,7 +288,7 @@ static void > edit_cmd(void) { > char n[MAX_FNAME], q[MAX_TEMPSTR], *editor; > FILE *f; >- int ch, t, x; >+ int ch, t; > struct stat statbuf, xstatbuf; > struct timespec mtimespec; > struct timeval tv[2]; >@@ -337,18 +344,7 @@ edit_cmd(void) { > > /* ignore the top few comments since we probably put them there. > */ >- x = 0; >- while (EOF != (ch = get_char(f))) { >- if ('#' != ch) { >- putc(ch, NewCrontab); >- break; >- } >- while (EOF != (ch = get_char(f))) >- if (ch == '\n') >- break; >- if (++x >= NHEADER_LINES) >- break; >- } >+ ch = ignore_comments(f); > > /* copy the rest of the crontab (if any) to the temp file. > */ >@@ -651,3 +647,24 @@ die(int x) { > (void) unlink(TempFilename); > _exit(ERROR_EXIT); > } >+ >+static int >+ignore_comments(FILE *f) { >+ int ch, x; >+ >+ x = 0; >+ while (EOF != (ch = get_char(f))) { >+ if ('#' != ch) { >+ putc(ch, NewCrontab); >+ break; >+ } >+ while (EOF != (ch = get_char(f))) >+ if (ch == '\n') >+ break; >+ if (++x >= NHEADER_LINES) >+ break; >+ } >+ >+ return ch; >+} >+
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 14751
: 2596