/[pkg-cron]/trunk/crontab.c
ViewVC logotype

Diff of /trunk/crontab.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 12 by steveg, Sun Apr 11 19:33:46 1999 UTC revision 14 by steveg, Sun Apr 11 19:34:04 1999 UTC
# Line 248  list_cmd() { Line 248  list_cmd() {
248          char    n[MAX_FNAME];          char    n[MAX_FNAME];
249          FILE    *f;          FILE    *f;
250          int     ch;          int     ch;
251    #ifdef DEBIAN
252            int     x;
253            char    *ctnh;
254    #endif
255    
256          log_it(RealUser, Pid, "LIST", User);          log_it(RealUser, Pid, "LIST", User);
257          (void) sprintf(n, CRON_TAB(User));          (void) sprintf(n, CRON_TAB(User));
# Line 262  list_cmd() { Line 266  list_cmd() {
266          /* file is open. copy to stdout, close.          /* file is open. copy to stdout, close.
267           */           */
268          Set_LineNum(1)          Set_LineNum(1)
269    #ifdef DEBIAN
270              /* DEBIAN: Don't list header lines if CRONTAB_NOHEADER is
271                 'Y'. Later we'll change this to the default */
272              /* ignore the top few comments since we probably put them there.
273               */
274              if ((ctnh = getenv("CRONTAB_NOHEADER")) &&
275                  toupper(*ctnh) == 'Y') {
276                for (x = 0;  x < NHEADER_LINES;  x++) {
277                  ch = get_char(f);
278                  if (EOF == ch)
279                    break;
280                  if ('#' != ch) {
281                    putc(ch, NewCrontab);
282                    break;
283                  }
284                  while (EOF != (ch = get_char(f)))
285                    if (ch == '\n')
286                      break;
287                  if (EOF == ch)
288                    break;
289                }
290              }
291    #endif
292          while (EOF != (ch = get_char(f)))          while (EOF != (ch = get_char(f)))
293                  putchar(ch);                  putchar(ch);
294          fclose(f);          fclose(f);

Legend:
Removed from v.12  
changed lines
  Added in v.14

  ViewVC Help
Powered by ViewVC 1.1.5